home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / Origami / bindings / fun / sokoban < prev    next >
Encoding:
Text File  |  1996-09-27  |  81.9 KB  |  1,753 lines

  1. @if-using not(ocl-file-sokoban)
  2.    @use (ocl-file-sokoban)
  3.    ( demand-load (
  4.       ;OCL{{{}}}
  5.       ;OCL{{{  reference description
  6.       @if-using ( FUN-REFERENCE ) ; 1 ;
  7.       This library defines  a  function  for  playing  the  well  known  game
  8.       `Sokoban'. Therefor  the file `~/.orisokoban' is used to store the game
  9.       boards. The  file  will be generated automatically with language Inmos,
  10.       to prevent  problems with different fold marks. Each level is stored in
  11.       a fold, using the following coding:
  12.  
  13.       @ref-start-item #
  14.       wall
  15.       @ref-end-item
  16.       @ref-start-item .
  17.       base
  18.       @ref-end-item
  19.       @ref-start-item $
  20.       stone
  21.       @ref-end-item
  22.       @ref-start-item *
  23.       stone on base
  24.       @ref-end-item
  25.       @ref-start-item @
  26.       cursor
  27.       @ref-end-item
  28.       @ref-start-item +
  29.       cursor on base
  30.       @ref-end-item
  31.  
  32.       The library defines a own keyboard. So it can only be used for bindings
  33.       with multiple modes.  The mode is named `sokoban-kbd'.  The functions
  34.  
  35.       @ref-start-picture
  36.          soko-go-or-push-up, soko-run-or-push-up, soko-run-up
  37.          soko-go-or-push-down, soko-run-or-push-down, soko-run-down
  38.          soko-go-or-push-left, soko-run-or-push-left, soko-run-left
  39.          soko-go-or-push-right, soko-run-or-push-right, soko-run-right
  40.       @ref-end-picture
  41.  
  42.  
  43.       are not undeclared, so they can be bound  to  your  cursor  keys.  This
  44.       library uses only the vi based bindings (hjkl).
  45.  
  46.       You have to define a function `SOKOBAN-RESET-KBD', which resets the
  47.       keytables to your default table.
  48.       @fi
  49.       ;OCL}}}
  50.       ;OCL{{{  libs
  51.       @if-using not(ocl-file-buff-size) @lib buff-size @fi
  52.       ;OCL}}}
  53.       ;OCL{{{  variables
  54.       ( defvar
  55.          ( soko-regexp
  56.            soko-homes
  57.            soko-play
  58.            soko-cmd
  59.            soko-mv
  60.            soko-pu
  61.            soko-undo
  62.            soko-undo-push
  63.            soko-undo-move
  64.            soko-undo-i-move
  65.            soko-saved
  66.            soko-saved-y
  67.            soko-saved-x
  68.            soko-saved-homes
  69.            soko-saved-mv
  70.            soko-saved-pu
  71.          )
  72.       )
  73.       ;OCL}}}
  74.       ;OCL{{{  define sokoban mode data
  75.       ( defmodes sokoban-kbd )
  76.       ( overload-prefix ( soko- ) )
  77.       ;OCL}}}
  78.       ;OCL{{{  sokoban
  79.       ;OCL{{{  reference
  80.       @if-using ( FUN-REFERENCE ) ; 2 ; sokoban-call-ref
  81.       ;OCL{{{  sokoban
  82.       You can play the well known game. You have to push the pakets to the
  83.       bases. Bases are marked with `.'. Pakets are marked with `$', or `S'
  84.       on bases. Running or pushing through walls (`#') is not possible.
  85.  
  86.       @ref-start-tbl Function 18 Key 3 Comment 36
  87.       go-or-push-up     @@  k  @@
  88.       run-or-push-up    @@  K  @@ repeat and stop at wall
  89.       run-up            @@ C-K @@ repeat and stop at wall or paket
  90.       go-or-push-down   @@  j  @@
  91.       run-or-push-down  @@  J  @@ repeat and stop at wall
  92.       run-down          @@ C-J @@ repeat and stop at wall or paket
  93.       go-or-push-left   @@  h  @@
  94.       run-or-push-left  @@  H  @@ repeat and stop at wall
  95.       run-left          @@ C-H @@ repeat and stop at wall or paket
  96.       go-or-push-right  @@  l  @@
  97.       run-or-push-right @@  L  @@ repeat and stop at wall
  98.       run-right         @@ C-L @@ repeat and stop at wall or paket
  99.       undo-last-move    @@  u  @@ if repeated, only the last one
  100.  
  101.       next-level        @@  +  @@ level has not to be solved
  102.       previous-level    @@  -  @@
  103.       save              @@  s  @@ not over different editing sessions
  104.       reset             @@  r  @@ to last save or start, if no save
  105.       restart-level     @@  R  @@ to start
  106.  
  107.       quit              @@  q  @@
  108.       describe-bindings @@  ?  @@
  109.       @ref-end-tbl
  110.  
  111.       Starting a level calls save automatically!
  112.       ;OCL}}}
  113.       @fi
  114.       ;OCL}}}
  115.  
  116.       ;OCL{{{  init boards
  117.       ;OCL{{{  soko-init-long-wall
  118.       ( deffun soko-init-long-wall
  119.          ( do
  120.             ( "#
  121.               set soko-cmd -(soko-cmd 1)
  122.             )
  123.            while soko-cmd
  124.          )
  125.       )
  126.       ;OCL}}}
  127.       ;OCL{{{  soko-init-board-1
  128.       ( deffun soko-init-board-1
  129.          (
  130.            ;OCL{{{  1
  131.            goto 1 create-fold create-fold
  132.            open-fold
  133.            newline-and-indent goto 5 set soko-cmd 5 soko-init-long-wall
  134.            newline-and-indent goto 5 "# "  "  "  "#
  135.            newline-and-indent goto 5 "#$ "  "  "#
  136.            newline-and-indent goto 3 "### "  "  "$##
  137.            newline-and-indent goto 3 "# "  "  "$ "  "$ "  "#
  138.            newline-and-indent goto 1 "### "  "# "  "## "  "# "  "  "  set soko-cmd 6 soko-init-long-wall
  139.            newline-and-indent goto 1 "# "  "  "  "# "  "## "  set soko-cmd 5 soko-init-long-wall "  "  "..#
  140.            newline-and-indent goto 1 "# "  "$ "  "  "$ goto 17 "..#
  141.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall "  "### "  "#@## "  "  "..#
  142.            newline-and-indent goto 5 "# "  "  "  "  "  set soko-cmd 9 soko-init-long-wall
  143.            newline-and-indent goto 5 set soko-cmd 7 soko-init-long-wall
  144.            close-fold
  145.            next-line
  146.            ;OCL}}}
  147.            ;OCL{{{  2
  148.            goto 1 create-fold create-fold
  149.            open-fold
  150.            newline-and-indent goto 1 set soko-cmd 12 soko-init-long-wall
  151.            newline-and-indent goto 1 "#.. "  "  "# "  "  "  "  "  "###
  152.            newline-and-indent goto 1 "#.. "  "  "# "  "$ "  "  "$ "  "  "#
  153.            newline-and-indent goto 1 "#.. "  "  "#$#### "  "  "#
  154.            newline-and-indent goto 1 "#.. "  "  "  "  "@ "  "## "  "  "#
  155.            newline-and-indent goto 1 "#.. "  "  "# "  "# "  "  "$ "  "##
  156.            newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall "  "##$ "  "$ "  "#
  157.            newline-and-indent goto 3 "# "  "$ "  "  "$ "  "$ "  "$ "  "#
  158.            newline-and-indent goto 3 "# "  "  "  "  "# "  "  "  "  "  "#
  159.            newline-and-indent goto 3 set soko-cmd 12 soko-init-long-wall
  160.            close-fold
  161.            next-line
  162.            ;OCL}}}
  163.            ;OCL{{{  3
  164.            goto 1 create-fold create-fold
  165.            open-fold
  166.            newline-and-indent goto 9 set soko-cmd 8 soko-init-long-wall
  167.            newline-and-indent goto 9 "# "  "  "  "  "  "@#
  168.            newline-and-indent goto 9 "# "  "$#$ "  "##
  169.            newline-and-indent goto 9 "# "  "$ "  "  "$#
  170.            newline-and-indent goto 9 "##$ "  "$ "  "#
  171.            newline-and-indent goto 1 set soko-cmd 9 soko-init-long-wall "  "$ "  "# "  "###
  172.            newline-and-indent goto 1 "#.... "  "  "## "  "$ "  "  "$ "  "  "#
  173.            newline-and-indent goto 1 "##... "  "  "  "  "$ "  "  "$ "  "  "  "#
  174.            newline-and-indent goto 1 "#.... "  "  set soko-cmd 10 soko-init-long-wall
  175.            newline-and-indent goto 1 set soko-cmd 8 soko-init-long-wall
  176.            close-fold
  177.            next-line
  178.            ;OCL}}}
  179.            ;OCL{{{  4
  180.            goto 1 create-fold create-fold
  181.            open-fold
  182.            newline-and-indent goto 12 set soko-cmd 8 soko-init-long-wall
  183.            newline-and-indent goto 12 "# "  "  "....#
  184.            newline-and-indent goto 1 set soko-cmd 12 soko-init-long-wall "  "  "....#
  185.            newline-and-indent goto 1 "# "  "  "  "  "# "  "  "$ "  "$ "  "  "  "....#
  186.            newline-and-indent goto 1 "# "  "$$ "$#$ "  "  "$ "  "# "  "  "....#
  187.            newline-and-indent goto 1 "# "  "  "$ "  "  "  "  "  "$ "  "# "  "  "....#
  188.            newline-and-indent goto 1 "# "  "$$ "  "#$ "  "$ "  "$ set soko-cmd 8 soko-init-long-wall
  189.            newline-and-indent goto 1 "# "  "  "$ "  "# "  "  "  "  "  "#
  190.            newline-and-indent goto 1 "## "  set soko-cmd 9 soko-init-long-wall
  191.            newline-and-indent goto 1 "# "  "  "  "  "# "  "  "  "  "##
  192.            newline-and-indent goto 1 "# "  "  "  "  "  "$ "  "  "  "##
  193.            newline-and-indent goto 1 "# "  "  "$$ "#$$ "  "  "@#
  194.            newline-and-indent goto 1 "# "  "  "  "  "# "  "  "  "  "##
  195.            newline-and-indent goto 1 set soko-cmd 11 soko-init-long-wall
  196.            close-fold
  197.            next-line
  198.            ;OCL}}}
  199.            ;OCL{{{  5
  200.            goto 1 create-fold create-fold
  201.            open-fold
  202.            newline-and-indent goto 9 set soko-cmd 5 soko-init-long-wall
  203.            newline-and-indent goto 9 "# "  "  "  set soko-cmd 5 soko-init-long-wall
  204.            newline-and-indent goto 9 "# "  "#$## "  "  "#
  205.            newline-and-indent goto 9 "# "  "  "  "  "  "$ "  "#
  206.            newline-and-indent goto 1 set soko-cmd 9 soko-init-long-wall "  "### "  "  "  "#
  207.            newline-and-indent goto 1 "#.... "  "  "## "  "$ "  "  "$###
  208.            newline-and-indent goto 1 "#.... "  "  "  "  "$ "  "$$ "  "##
  209.            newline-and-indent goto 1 "#.... "  "  "##$ "  "  "$ "  "@#
  210.            newline-and-indent goto 1 set soko-cmd 9 soko-init-long-wall "  "  "$ "  "  "##
  211.            newline-and-indent goto 9 "# "  "$ "  "$ "  "  "#
  212.            newline-and-indent goto 9 "### "  "## "  "#
  213.            newline-and-indent goto 11 "# "  "  "  "  "#
  214.            newline-and-indent goto 11 set soko-cmd 6 soko-init-long-wall
  215.            close-fold
  216.            next-line
  217.            ;OCL}}}
  218.            ;OCL{{{  6
  219.            goto 1 create-fold create-fold
  220.            open-fold
  221.            newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall "  "  "###
  222.            newline-and-indent goto 1 "#.. "  "  "# "  "##@##
  223.            newline-and-indent goto 1 "#.. "  "  "### "  "  "  "#
  224.            newline-and-indent goto 1 "#.. "  "  "  "  "  "$$ "  "#
  225.            newline-and-indent goto 1 "#.. "  "  "# "  "# "  "$ "  "#
  226.            newline-and-indent goto 1 "#..### "  "# "  "$ "  "#
  227.            newline-and-indent goto 1 "#### "  "$ "  "#$ "  "  "#
  228.            newline-and-indent goto 4 "# "  "  "$# "  "$ "  "#
  229.            newline-and-indent goto 4 "# "  "$ "  "  "$ "  "  "#
  230.            newline-and-indent goto 4 "# "  "  "## "  "  "  "#
  231.            newline-and-indent goto 4 set soko-cmd 9 soko-init-long-wall
  232.            close-fold
  233.            next-line
  234.            ;OCL}}}
  235.            ;OCL{{{  7
  236.            goto 1 create-fold create-fold
  237.            open-fold
  238.            newline-and-indent goto 8 set soko-cmd 5 soko-init-long-wall
  239.            newline-and-indent goto 2 set soko-cmd 7 soko-init-long-wall "  "  "  "##
  240.            newline-and-indent goto 1 "## "  "# "  "@## "  "$$ "  "#
  241.            newline-and-indent goto 1 "# "  "  "  "  "$ goto 13 "#
  242.            newline-and-indent goto 1 "# "  "  "$ "  "  "### "  "  "  "#
  243.            newline-and-indent goto 1 "### "  set soko-cmd 5 soko-init-long-wall "$###
  244.            newline-and-indent goto 1 "# "  "$ "  "  "### "  "..#
  245.            newline-and-indent goto 1 "# "  "$ "  "$ "  "$ "  "...#
  246.            newline-and-indent goto 1 "# "  "  "  "  "###...#
  247.            newline-and-indent goto 1 "# "  "$$ "  "# "  "#...#
  248.            newline-and-indent goto 1 "# "  "  "### "  set soko-cmd 5 soko-init-long-wall
  249.            newline-and-indent goto 1 "####
  250.            close-fold
  251.            next-line
  252.            ;OCL}}}
  253.            ;OCL{{{  8
  254.            goto 1 create-fold create-fold
  255.            open-fold
  256.            newline-and-indent goto 3 "####
  257.            newline-and-indent goto 3 "# "  "  set soko-cmd 11 soko-init-long-wall
  258.            newline-and-indent goto 3 "# "  "  "  "  "$ "  "  "  "$ "  "$ "  "#
  259.            newline-and-indent goto 3 "# "  "$# "  "$ "  "# "  "  "$ "  "  "#
  260.            newline-and-indent goto 3 "# "  "  "$ "  "$ "  "  "# "  "  "  "  "#
  261.            newline-and-indent goto 1 "### "  "$# "  "# "  "  "#### "  "#
  262.            newline-and-indent goto 1 "#@#$ "  "$ "  "$ "  "  "## "  "  "  "#
  263.            newline-and-indent goto 1 "# "  "  "  "  "$ "  "#$# "  "  "  "# "  "#
  264.            newline-and-indent goto 1 "# "  "  "  "$ "  "  "  "  "$ "  "$ "  "$ "  "#
  265.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall "  "  set soko-cmd 9 soko-init-long-wall
  266.            newline-and-indent goto 3 "# goto 10 "#
  267.            double-line
  268.            newline-and-indent goto 3 "#......#
  269.            double-line
  270.            double-line
  271.            newline-and-indent goto 3 set soko-cmd 8 soko-init-long-wall
  272.            close-fold
  273.            next-line
  274.            ;OCL}}}
  275.            ;OCL{{{  9
  276.            goto 1 create-fold create-fold
  277.            open-fold
  278.            newline-and-indent goto 11 set soko-cmd 7 soko-init-long-wall
  279.            newline-and-indent goto 11 "# "  "  "...#
  280.            newline-and-indent goto 7 set soko-cmd 5 soko-init-long-wall "  "  "...#
  281.            newline-and-indent goto 7 "# goto 14 ". "  ".#
  282.            newline-and-indent goto 7 "# "  "  "## "  "  "...#
  283.            newline-and-indent goto 7 "## "  "## "  "  "...#
  284.            newline-and-indent goto 6 "### "  set soko-cmd 8 soko-init-long-wall
  285.            newline-and-indent goto 6 "# "  "$$ "$ "  "##
  286.            newline-and-indent goto 2 set soko-cmd 5 soko-init-long-wall "  "  "$ "  "$ "  set soko-cmd 5 soko-init-long-wall
  287.            newline-and-indent goto 1 "## "  "  "  "#$ "  "$ "  "  "  "# "  "  "  "#
  288.            newline-and-indent goto 1 "#@ "  "$ "  "  "$ "  "  "  "  "$ "  "  "$ "  "#
  289.            newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall "  "$$ "  "$ "  set soko-cmd 5 soko-init-long-wall
  290.            newline-and-indent goto 6 "# goto 13 "#
  291.            newline-and-indent goto 6 set soko-cmd 8 soko-init-long-wall
  292.            close-fold
  293.            next-line
  294.            ;OCL}}}
  295.            ;OCL{{{  10
  296.            goto 1 create-fold create-fold
  297.            open-fold
  298.            newline-and-indent goto 2 "### "  "  set soko-cmd 13 soko-init-long-wall
  299.            newline-and-indent goto 1 "##@#### goto 15 "# "  "  "  "#
  300.            newline-and-indent goto 1 "# "  "$$ "  "  "  "$$ "  "  "$ "  "$ "  "...#
  301.            newline-and-indent goto 1 "# "  "  "$$ "$# "  "  "  "  "$ "  "  "#...#
  302.            newline-and-indent goto 1 "# "  "$ "  "  "  "# "  "$$ "  "$$ "  "#...#
  303.            newline-and-indent goto 1 "### "  "  "  "# "  "  "$ "  "  "  "  "#...#
  304.            newline-and-indent goto 1 "# "  "  "  "  "  "# "  "$ "  "$ "  "$ "  "#...#
  305.            newline-and-indent goto 1 "# "  "  "  "  set soko-cmd 6 soko-init-long-wall "  "###...#
  306.            newline-and-indent goto 1 "## "  "# "  "  "# "  "  "$ "  "$ "  "  "#...#
  307.            newline-and-indent goto 1 "# "  "  "## "  "# "  "$$ "  "$ "  "$##..#
  308.            newline-and-indent goto 1 "# "  "..# "  "# "  "  "$ goto 17 "#.#
  309.            newline-and-indent goto 1 "# "  "..# "  "# "  "$$ "$ "  "$$ "$ "  "#.#
  310.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall "  "# goto 15 "# "  "#.#
  311.            newline-and-indent goto 5 "# "  set soko-cmd 9 soko-init-long-wall "  "#.#
  312.            newline-and-indent goto 5 "# goto 17 "#.#
  313.            newline-and-indent goto 5 set soko-cmd 15 soko-init-long-wall
  314.            close-fold
  315.            next-line
  316.            ;OCL}}}
  317.          )
  318.       )
  319.       ;OCL}}}
  320.       ;OCL{{{  soko-init-board-2
  321.       ( deffun soko-init-board-2
  322.          (
  323.            ;OCL{{{  11
  324.            goto 1 create-fold create-fold
  325.            open-fold
  326.            newline-and-indent goto 11 "####
  327.            newline-and-indent goto 6 "#### "  "# "  "  "#
  328.            newline-and-indent goto 4 "### "  "@###$ "  "#
  329.            newline-and-indent goto 3 "## goto 11 "$ "  "  "#
  330.            newline-and-indent goto 2 "## "  "  "$ "  "$$ "## "  "##
  331.            newline-and-indent goto 2 "# "  "  "#$## "  "  "  "  "  "#
  332.            newline-and-indent goto 2 "# "  "# "  "$ "  "$$ "  "# "  "###
  333.            newline-and-indent goto 2 "# "  "  "  "$ "  "# "  "  "# "  "$ "  set soko-cmd 5 soko-init-long-wall
  334.            newline-and-indent goto 1 "#### "  "  "  "  "# "  "  "$$ "  "# "  "  "  "#
  335.            newline-and-indent goto 1 "#### "  "## "  "$ goto 19 "#
  336.            newline-and-indent goto 1 "#. "  "  "  "  "### "  "  set soko-cmd 8 soko-init-long-wall
  337.            newline-and-indent goto 1 "#.. "  "..# "  "####
  338.            newline-and-indent goto 1 "#...#.#
  339.            newline-and-indent goto 1 "#.....#
  340.            newline-and-indent goto 1 set soko-cmd 7 soko-init-long-wall
  341.            close-fold
  342.            next-line
  343.            ;OCL}}}
  344.            ;OCL{{{  12
  345.            goto 1 create-fold create-fold
  346.            open-fold
  347.            newline-and-indent goto 1 set soko-cmd 16 soko-init-long-wall
  348.            newline-and-indent goto 1 "# goto 16 "#
  349.            newline-and-indent goto 1 "# "  "# "  set soko-cmd 6 soko-init-long-wall "  "  "  "  "  "#
  350.            newline-and-indent goto 1 "# "  "# "  "  "$ "  "$ "  "$ "  "$# "  "  "#
  351.            newline-and-indent goto 1 "# "  "# "  "  "  "$@$ "  "  "  "## "  "##
  352.            newline-and-indent goto 1 "# "  "# "  "  "$ "  "$ "  "$###...#
  353.            newline-and-indent goto 1 "# "  "# "  "  "  "$ "  "$ "  "  "##...#
  354.            newline-and-indent goto 1 "# "  "###$$ "$ "  "$ "  "##...#
  355.            newline-and-indent goto 1 "# "  "  "  "  "  "# "  "## "  "##...#
  356.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall "  "  "  "## "  "##...#
  357.            newline-and-indent goto 5 set soko-cmd 5 soko-init-long-wall "  "  "  "  "  "###
  358.            newline-and-indent goto 9 "# "  "  "  "  "  "#
  359.            newline-and-indent goto 9 set soko-cmd 7 soko-init-long-wall
  360.            close-fold
  361.            next-line
  362.            ;OCL}}}
  363.            ;OCL{{{  13
  364.            goto 1 create-fold create-fold
  365.            open-fold
  366.            newline-and-indent goto 4 set soko-cmd 9 soko-init-long-wall
  367.            newline-and-indent goto 3 "## "  "  "  "## "  "  set soko-cmd 5 soko-init-long-wall
  368.            newline-and-indent goto 1 "### "  "  "  "  "  "# "  "  "# "  "  "  "  "###
  369.            newline-and-indent goto 1 "# "  "  "$ "  "#$ "  "# "  "  "# "  "  "... "  "#
  370.            newline-and-indent goto 1 "# "  "# "  "$#@$## "  "# "  "#.#. "  "#
  371.            newline-and-indent goto 1 "# "  "  "# "  "#$ "  "  "# "  "  "  "  ". "  ". "  "#
  372.            newline-and-indent goto 1 "# "  "$ "  "  "  "  "$ "  "# "  "# "  "#.#. "  "#
  373.            newline-and-indent goto 1 "# "  "  "  "## "  "  "##$ "  "$ "  ". "  ". "  "#
  374.            newline-and-indent goto 1 "# "  "$ "  "# "  "  "  "# "  "  "#$#.#. "  "#
  375.            newline-and-indent goto 1 "## "  "$ "  "  "$ "  "  "  "$ "  "  "$... "  "#
  376.            newline-and-indent goto 2 "#$ "  set soko-cmd 6 soko-init-long-wall "  "  "  "  "## "  "  "#
  377.            newline-and-indent goto 2 "# "  "  "# "  "  "  "  set soko-cmd 10 soko-init-long-wall
  378.            newline-and-indent goto 2 "####
  379.            close-fold
  380.            next-line
  381.            ;OCL}}}
  382.            ;OCL{{{  14
  383.            goto 1 create-fold create-fold
  384.            open-fold
  385.            newline-and-indent goto 8 set soko-cmd 7 soko-init-long-wall
  386.            newline-and-indent goto 2 set soko-cmd 7 soko-init-long-wall "  "  "  "  "  "#
  387.            newline-and-indent goto 2 "# "  "  "  "  "  "# "  "$@$ "  "#
  388.            newline-and-indent goto 2 "#$$ "  "# "  "  "  set soko-cmd 9 soko-init-long-wall
  389.            newline-and-indent goto 2 "# "  "###......## "  "  "  "#
  390.            newline-and-indent goto 2 "# "  "  "  "$......## "  "# "  "#
  391.            newline-and-indent goto 2 "# "  "###...... "  "  "  "  "  "#
  392.            newline-and-indent goto 1 "## "  "  "  "#### "  "### "  "#$##
  393.            newline-and-indent goto 1 "# "  "  "#$ "  "  "  "# "  "  "$ "  "  "# "  "#
  394.            newline-and-indent goto 1 "# "  "  "$ "  "$$ "$ "  "  "# "  "$## "  "#
  395.            newline-and-indent goto 1 "# "  "  "  "$ "  "$ "  "###$$ "  "# "  "#
  396.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall "  "  "  "  "  "$ "  "  "  "# "  "#
  397.            newline-and-indent goto 5 "### "  "### "  "  "  "# "  "#
  398.            newline-and-indent goto 7 "# "  "  "  "  "  "# "  "  "  "#
  399.            newline-and-indent goto 7 set soko-cmd 8 soko-init-long-wall "  "  "#
  400.            newline-and-indent goto 14 "####
  401.            close-fold
  402.            next-line
  403.            ;OCL}}}
  404.            ;OCL{{{  15
  405.            goto 1 create-fold create-fold
  406.            open-fold
  407.            newline-and-indent goto 4 set soko-cmd 8 soko-init-long-wall
  408.            newline-and-indent goto 4 "# "  "  "  "# "  "  "#
  409.            newline-and-indent goto 4 "# "  "  "$ "  "  "  "#
  410.            newline-and-indent goto 2 "### "  "#$ "  "  "  "####
  411.            newline-and-indent goto 2 "# "  "  "$ "  "  "##$ "  "  "  "#
  412.            newline-and-indent goto 2 "# "  "  "# "  "@ "  "$ "  "# "  "$#
  413.            newline-and-indent goto 2 "# "  "  "# goto 12 "$ "  "####
  414.            newline-and-indent goto 2 "## "  "####$## "  "  "  "  "  "#
  415.            newline-and-indent goto 2 "# "  "$#.....# "  "# "  "  "  "#
  416.            newline-and-indent goto 2 "# "  "  "$..**. "  "$# "  "###
  417.            newline-and-indent goto 1 "## "  "  "#.....# "  "  "  "#
  418.            newline-and-indent goto 1 "# "  "  "  "### "  set soko-cmd 7 soko-init-long-wall
  419.            newline-and-indent goto 1 "# "  "$$ "  "  "# "  "  "#
  420.            newline-and-indent goto 1 "# "  "  "# "  "  "  "  "  "#
  421.            newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall "  "  "  "#
  422.            newline-and-indent goto 6 set soko-cmd 5 soko-init-long-wall
  423.            close-fold
  424.            next-line
  425.            ;OCL}}}
  426.            ;OCL{{{  16
  427.            goto 1 create-fold create-fold
  428.            open-fold
  429.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall
  430.            newline-and-indent goto 1 "# "  "  "  "##
  431.            newline-and-indent goto 1 "# "  "  "  "  "# "  "  "####
  432.            newline-and-indent goto 1 "# "  "$ "  "  "#### "  "  "#
  433.            newline-and-indent goto 1 "# "  "  "$$ "  "$ "  "  "  "$#
  434.            newline-and-indent goto 1 "###@ "  "#$ "  "  "  "  "##
  435.            newline-and-indent goto 2 "# "  "  "## "  "  "$ "  "$ "  "##
  436.            newline-and-indent goto 2 "# "  "$ "  "  "## "  "## "  ".#
  437.            newline-and-indent goto 2 "# "  "  "#$##$ "  "  "#.#
  438.            newline-and-indent goto 2 "### "  "  "  "$..##.#
  439.            newline-and-indent goto 3 "# "  "  "  "  "#.*...#
  440.            newline-and-indent goto 3 "# "  "$$ "  "#.....#
  441.            newline-and-indent goto 3 "# "  "  set soko-cmd 9 soko-init-long-wall
  442.            newline-and-indent goto 3 "# "  "  "#
  443.            newline-and-indent goto 3 "####
  444.            close-fold
  445.            next-line
  446.            ;OCL}}}
  447.            ;OCL{{{  17
  448.            goto 1 create-fold create-fold
  449.            open-fold
  450.            newline-and-indent goto 4 set soko-cmd 10 soko-init-long-wall
  451.            newline-and-indent goto 4 "#.. "  "  "# "  "  "  "#
  452.            newline-and-indent goto 4 "#.. goto 13 "#
  453.            newline-and-indent goto 4 "#.. "  "  "# "  "  "####
  454.            newline-and-indent goto 3 set soko-cmd 7 soko-init-long-wall "  "  "# "  "  "##
  455.            newline-and-indent goto 3 "# goto 16 "#
  456.            newline-and-indent goto 3 "# "  "  "# "  "  "## "  "  "# "  "  "#
  457.            newline-and-indent goto 1 "#### "  "## "  "  "#### "  "##
  458.            newline-and-indent goto 1 "# "  "  "$ "  "  set soko-cmd 5 soko-init-long-wall "  "# "  "  "#
  459.            newline-and-indent goto 1 "# "  "# "  "$ "  "  "$ "  "  "# "  "$ "  "  "#
  460.            newline-and-indent goto 1 "# "  "@$ "  "  "$ "  "  "  "# "  "  "  "##
  461.            newline-and-indent goto 1 "#### "  "## "  set soko-cmd 7 soko-init-long-wall
  462.            newline-and-indent goto 4 "# "  "  "  "  "#
  463.            newline-and-indent goto 4 set soko-cmd 6 soko-init-long-wall
  464.            close-fold
  465.            next-line
  466.            ;OCL}}}
  467.            ;OCL{{{  18
  468.            goto 1 create-fold create-fold
  469.            open-fold
  470.            newline-and-indent goto 6 set soko-cmd 11 soko-init-long-wall
  471.            newline-and-indent goto 6 "# "  "  ". "  "  "# "  "  "  "#
  472.            newline-and-indent goto 6 "# "  "#. "  "  "  "  "@ "  "#
  473.            newline-and-indent goto 2 set soko-cmd 5 soko-init-long-wall "  "##..# "  "####
  474.            newline-and-indent goto 1 "## "  "  "# "  "..### "  "  "  "  "  "###
  475.            newline-and-indent goto 1 "# "  "$ "  "#... "  "  "  "$ "  "# "  "  "$ "  "#
  476.            newline-and-indent goto 1 "# "  "  "  "  ".. "  "## "  "  "## "  "## "  "#
  477.            newline-and-indent goto 1 "####$##$# "  "$ "  "# "  "  "  "# "  "#
  478.            newline-and-indent goto 3 "## "  "# "  "  "  "  "#$ "  "$$ "  "# "  "#
  479.            newline-and-indent goto 3 "# "  "  "$ "  "# "  "# "  "  "# "  "$## "  "#
  480.            newline-and-indent goto 3 "# goto 19 "#
  481.            newline-and-indent goto 3 "# "  "  set soko-cmd 11 soko-init-long-wall "  "  "#
  482.            newline-and-indent goto 3 "#### goto 16 "####
  483.            close-fold
  484.            next-line
  485.            ;OCL}}}
  486.            ;OCL{{{  19
  487.            goto 1 create-fold create-fold
  488.            open-fold
  489.            newline-and-indent goto 3 set soko-cmd 6 soko-init-long-wall
  490.            newline-and-indent goto 3 "# "  "  "  "@####
  491.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall "  "$ "  "  "  "#
  492.            newline-and-indent goto 1 "# "  "  "  "## "  "  "  "  "####
  493.            newline-and-indent goto 1 "# "  "$ "  "# "  "  "## "  "  "  "  "#
  494.            newline-and-indent goto 1 "# "  "$ "  "# "  "  set soko-cmd 5 soko-init-long-wall "  "#
  495.            newline-and-indent goto 1 "## "  "$ "  "  "$ "  "  "  "  "# "  "#
  496.            newline-and-indent goto 1 "## "  "$ "  "$ "  "### "  "# "  "#
  497.            newline-and-indent goto 1 "## "  "# "  "  "$ "  "  "# "  "# "  "#
  498.            newline-and-indent goto 1 "## "  "# "  "#$# "  "  "  "# "  "#
  499.            newline-and-indent goto 1 "## "  "### "  "  "  "# "  "# "  set soko-cmd 6 soko-init-long-wall
  500.            newline-and-indent goto 1 "# "  "  "$ "  "  "#### "  "# "  "#....#
  501.            newline-and-indent goto 1 "# "  "  "  "  "$ "  "  "  "  "$ "  "  "  "..#.#
  502.            newline-and-indent goto 1 "####$ "  "  "$# "  "$ "  "  "  "....#
  503.            newline-and-indent goto 1 "# goto 9 "# "  "  "## "  "....#
  504.            newline-and-indent goto 1 set soko-cmd 19 soko-init-long-wall
  505.            close-fold
  506.            next-line
  507.            ;OCL}}}
  508.            ;OCL{{{  20
  509.            goto 1 create-fold create-fold
  510.            open-fold
  511.            newline-and-indent goto 5 set soko-cmd 10 soko-init-long-wall
  512.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall goto 14 "####
  513.            newline-and-indent goto 1 "# "  "  "  "  "  "# "  "  "  "$ "  "  "#@ "  "#
  514.            newline-and-indent goto 1 "# "  set soko-cmd 7 soko-init-long-wall "$#### "  "  "###
  515.            newline-and-indent goto 1 "# "  "# "  "  "  "  "## "  "# "  "  "#$ "  "..#
  516.            newline-and-indent goto 1 "# "  "# "  "$ "  "  "  "  "  "# "  "  "# "  "  "#.#
  517.            newline-and-indent goto 1 "# "  "# "  "$ "  "  "# "  "  "  "  "  "#$ "  "..#
  518.            newline-and-indent goto 1 "# "  "# "  "  "### "  "## "  "  "  "  "  "#.#
  519.            newline-and-indent goto 1 "# "  "### "  "  "# "  "  "# "  "  "#$ "  "..#
  520.            newline-and-indent goto 1 "# "  "# "  "  "  "  "# "  "  "#### "  "  "#.#
  521.            newline-and-indent goto 1 "# "  "#$ "  "  "  "$ "  "  "$ "  "  "#$ "  "..#
  522.            newline-and-indent goto 1 "# "  "  "  "  "$ "  "# "  "$ "  "$ "  "# "  "  "#.#
  523.            newline-and-indent goto 1 "#### "  "$### "  "  "  "  "#$ "  "..#
  524.            newline-and-indent goto 4 "# "  "  "  "  "$$ "  "###....#
  525.            newline-and-indent goto 4 "# goto 11 "## "  set soko-cmd 6 soko-init-long-wall
  526.            newline-and-indent goto 4 set soko-cmd 8 soko-init-long-wall
  527.            close-fold
  528.            next-line
  529.            ;OCL}}}
  530.          )
  531.       )
  532.       ;OCL}}}
  533.       ;OCL{{{  soko-init-board-3
  534.       ( deffun soko-init-board-3
  535.          (
  536.            ;OCL{{{  21
  537.            goto 1 create-fold create-fold
  538.            open-fold
  539.            newline-and-indent goto 1 set soko-cmd 9 soko-init-long-wall
  540.            newline-and-indent goto 1 "# goto 9 "#
  541.            newline-and-indent goto 1 "# goto 9 "####
  542.            newline-and-indent goto 1 "## "  "#### "  "# "  "  "#
  543.            newline-and-indent goto 1 "## "  "#@## "  "  "  "  "#
  544.            newline-and-indent goto 1 "# "  "$$ "$ "  "$ "  "  "$$ "#
  545.            newline-and-indent goto 1 "# "  "  "# "  "## "  "$ "  "  "#
  546.            newline-and-indent goto 1 "# "  "  "# "  "## "  "  "$ "  "####
  547.            newline-and-indent goto 1 "#### "  "  "$$ "$ "  "$# "  "  "#
  548.            newline-and-indent goto 2 "# "  "  "  "## "  "  "  "....#
  549.            newline-and-indent goto 2 "# "  "# "  "  "  "# "  "#.. "  ".#
  550.            newline-and-indent goto 2 "# "  "  "  "# "  "# "  "##...#
  551.            newline-and-indent goto 2 set soko-cmd 5 soko-init-long-wall "  "$ "  "  "#...#
  552.            newline-and-indent goto 6 "## "  "  "  set soko-cmd 5 soko-init-long-wall
  553.            newline-and-indent goto 7 set soko-cmd 5 soko-init-long-wall
  554.            close-fold
  555.            next-line
  556.            ;OCL}}}
  557.            ;OCL{{{  22
  558.            goto 1 create-fold create-fold
  559.            open-fold
  560.            newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall "  "  "  "  "  "####
  561.            newline-and-indent goto 1 "# "  "  "  "  set soko-cmd 7 soko-init-long-wall "  "  set soko-cmd 5 soko-init-long-wall
  562.            newline-and-indent goto 1 "# "  "  "  "$# "  "  "# "  "  "$ "  "  "# "  "  "  "#
  563.            newline-and-indent goto 1 "# "  "  "$ "  "  "$ "  "  "$ "  "# "  "$ "  "$ "  "  "#
  564.            newline-and-indent goto 1 "##$ "  "$ "  "  "  "# "  "@# "  "$ "  "  "  "  "#
  565.            newline-and-indent goto 1 "# "  "  "$ "  set soko-cmd 11 soko-init-long-wall "  "##
  566.            newline-and-indent goto 1 "# "  "# "  "  "  "#.......# "  "$#
  567.            newline-and-indent goto 1 "# "  "## "  "  "# "  "......# "  "  "#
  568.            newline-and-indent goto 1 "# "  "# "  "  "  "$........$ "  "#
  569.            newline-and-indent goto 1 "# "  "# "  "$ "  "#.... "  "..# "  "  "#
  570.            newline-and-indent goto 1 "# "  "  "$ "  "$####$#### "  "$#
  571.            newline-and-indent goto 1 "# "  "$ "  "  "  "### "  "$ "  "  "  "$ "  "  "##
  572.            newline-and-indent goto 1 "# "  "$ "  "  "  "  "  "$ "  "$ "  "  "$ "  "  "  "  "#
  573.            newline-and-indent goto 1 "## "  set soko-cmd 6 soko-init-long-wall "  "$ "  set soko-cmd 5 soko-init-long-wall "  "#
  574.            newline-and-indent goto 1 "# goto 11 "# goto 19 "#
  575.            newline-and-indent goto 1 set soko-cmd 19 soko-init-long-wall
  576.            close-fold
  577.            next-line
  578.            ;OCL}}}
  579.            ;OCL{{{  23
  580.            goto 1 create-fold create-fold
  581.            open-fold
  582.            newline-and-indent goto 5 set soko-cmd 7 soko-init-long-wall
  583.            newline-and-indent goto 5 "# "  "  "# "  "  "####
  584.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall "  "$#$ "  "# "  "  "##
  585.            newline-and-indent goto 1 "#.. "  "# "  "  "# "  "  "# "  "  "  "#
  586.            newline-and-indent goto 1 "#.. "  "# "  "$#$ "  "# "  "  "$####
  587.            newline-and-indent goto 1 "#. "  "  "# "  "  "  "  "  "#$ "  "  "# "  "  "#
  588.            newline-and-indent goto 1 "#.. "  "  "  "$# "  "  "# "  "$ "  "  "  "  "#
  589.            newline-and-indent goto 1 "#..@# "  "  "#$ "  "#$ "  "  "# "  "  "#
  590.            newline-and-indent goto 1 "#.. "  "# "  "$# "  "  "  "  "  "$# "  "  "#
  591.            newline-and-indent goto 1 "#.. "  "# "  "  "#$$ "#$ "  "  "# "  "  "##
  592.            newline-and-indent goto 1 "#.. "  "# "  "$# "  "  "# "  "  "$#$ "  "  "#
  593.            newline-and-indent goto 1 "#.. "  "# "  "  "# "  "  "# "  "  "  "# "  "  "  "#
  594.            newline-and-indent goto 1 "##. "  "#### "  "  set soko-cmd 5 soko-init-long-wall "  "  "  "#
  595.            newline-and-indent goto 2 "#### "  "  "#### "  "  "  set soko-cmd 5 soko-init-long-wall
  596.            close-fold
  597.            next-line
  598.            ;OCL}}}
  599.            ;OCL{{{  24
  600.            goto 1 create-fold create-fold
  601.            open-fold
  602.            newline-and-indent goto 1 set soko-cmd 15 soko-init-long-wall
  603.            newline-and-indent goto 1 "#.......... "  "  ".####
  604.            newline-and-indent goto 1 "#..........$$ ".# "  "  "#
  605.            newline-and-indent goto 1 set soko-cmd 11 soko-init-long-wall "$ "  "# "  "  "  "##
  606.            newline-and-indent goto 1 "# goto 8 "$ "  "  "$ "  "  "  "  "  "$ "  "#
  607.            newline-and-indent goto 1 "## "  "#### "  "  "  "# "  "  "$ "  "# "  "  "#
  608.            newline-and-indent goto 1 "# goto 8 "# "  "  "  "## "  "  "# "  "##
  609.            newline-and-indent goto 1 "# "  "  "$# "  "  "# "  "## "  "  "### "  "##
  610.            newline-and-indent goto 1 "# "  "$ "  "#$### "  "  "  "  "### "  "##
  611.            newline-and-indent goto 1 "### "  "  "$ "  "# "  "  "# "  "  "### "  "##
  612.            newline-and-indent goto 1 "### "  "  "  "  "$ "  "## "  "# "  "  "# "  "##
  613.            newline-and-indent goto 2 "# "  "$ "  "  "# "  "  "$ "  "  "$ "  "$ "  "  "  "#
  614.            newline-and-indent goto 2 "# "  "  "$ "  "  "$#$$ "$ "  "  "# "  "  "  "#
  615.            newline-and-indent goto 2 "# "  "  "# "  "  "$ goto 15 set soko-cmd 5 soko-init-long-wall
  616.            newline-and-indent goto 2 "# "  "@## "  "  "# "  "  "# "  "  "#
  617.            newline-and-indent goto 2 set soko-cmd 14 soko-init-long-wall
  618.            close-fold
  619.            next-line
  620.            ;OCL}}}
  621.            ;OCL{{{  25
  622.            goto 1 create-fold create-fold
  623.            open-fold
  624.            newline-and-indent goto 1 "####
  625.            newline-and-indent goto 1 "# "  "  set soko-cmd 14 soko-init-long-wall
  626.            newline-and-indent goto 1 "# "  "  "# "  "  "  "..#......#
  627.            newline-and-indent goto 1 "# "  "  "# "  "# "  set soko-cmd 5 soko-init-long-wall "  "...#
  628.            newline-and-indent goto 1 "##$# "  "  "  "  "........#
  629.            newline-and-indent goto 1 "# "  "  "  "##$ set soko-cmd 6 soko-init-long-wall "  "  "####
  630.            newline-and-indent goto 1 "# "  "$ "  "# "  "  "  "  "  set soko-cmd 6 soko-init-long-wall "@ "  "#
  631.            newline-and-indent goto 1 "##$ "  "# "  "$ "  "  "  set soko-cmd 6 soko-init-long-wall "  "  "#
  632.            newline-and-indent goto 1 "# "  "  "$ "  "#$$ "$## goto 19 "#
  633.            newline-and-indent goto 1 "# goto 8 "# "  "  "  "  "#$#$###
  634.            newline-and-indent goto 1 "# "  "#### "  "#$$ "$$ "$ "  "  "  "  "#
  635.            newline-and-indent goto 1 "# "  "# "  "  "  "  "$ "  "  "  "  "  "# "  "  "  "#
  636.            newline-and-indent goto 1 "# "  "# "  "  "  "## goto 17 "###
  637.            newline-and-indent goto 1 "# "  set soko-cmd 6 soko-init-long-wall "$ set soko-cmd 6 soko-init-long-wall "  "$ "  "#
  638.            newline-and-indent goto 1 "# goto 10 "# "  "  "  "  "# "  "  "  "#
  639.            newline-and-indent goto 1 set soko-cmd 10 soko-init-long-wall "  "  "  "  set soko-cmd 5 soko-init-long-wall
  640.            close-fold
  641.            next-line
  642.            ;OCL}}}
  643.            ;OCL{{{  26
  644.            goto 1 create-fold create-fold
  645.            open-fold
  646.            newline-and-indent goto 2 set soko-cmd 7 soko-init-long-wall
  647.            newline-and-indent goto 2 "# "  "  "# "  "  set soko-cmd 5 soko-init-long-wall
  648.            newline-and-indent goto 1 "## "  "  "# "  "  "#...###
  649.            newline-and-indent goto 1 "# "  "  "$# "  "  "#... "  "  "#
  650.            newline-and-indent goto 1 "# "  "$ "  "#$$ "  "... "  "  "#
  651.            newline-and-indent goto 1 "# "  "  "$# "  "  "#... "  ".#
  652.            newline-and-indent goto 1 "# "  "  "  "# "  "$ set soko-cmd 8 soko-init-long-wall
  653.            newline-and-indent goto 1 "##$ goto 11 "$ "  "$ "  "#
  654.            newline-and-indent goto 1 "## "  "  "# "  "  "$$ "  "# "  "  "  "#
  655.            newline-and-indent goto 2 set soko-cmd 6 soko-init-long-wall "  "  "##$$ "@#
  656.            newline-and-indent goto 7 "# goto 14 "##
  657.            newline-and-indent goto 7 set soko-cmd 8 soko-init-long-wall
  658.            close-fold
  659.            next-line
  660.            ;OCL}}}
  661.            ;OCL{{{  27
  662.            goto 1 create-fold create-fold
  663.            open-fold
  664.            newline-and-indent goto 2 set soko-cmd 17 soko-init-long-wall
  665.            newline-and-indent goto 2 "#... "  "  "  "# "  "  "  "  "# "  "  "  "##
  666.            newline-and-indent goto 1 "##..... "  "  "$## "  "# "  "#$ "  "#
  667.            newline-and-indent goto 1 "#......# "  "  "$ "  "  "# "  "  "  "  "#
  668.            newline-and-indent goto 1 "#......# "  "  "# "  "  "# "  "# "  "  "#
  669.            newline-and-indent goto 1 set soko-cmd 9 soko-init-long-wall "  "$ "  "  "$ "  "$ "  "  "#
  670.            newline-and-indent goto 3 "# "  "  "  "  "  "#$##$ "  "##$##
  671.            newline-and-indent goto 2 "## "  "  "  "$ "  "  "  "  "# "  "$ "  "  "  "  "#
  672.            newline-and-indent goto 2 "# "  "  "## "  "### "  "# "  "  "##$ "  "#
  673.            newline-and-indent goto 2 "# "  "$ "  "$$ "  "  "  "  "  "$ "  "  "$ "  "  "#
  674.            newline-and-indent goto 2 "# "  "$ "  "  "  "  "$##$ "  set soko-cmd 6 soko-init-long-wall
  675.            newline-and-indent goto 2 set soko-cmd 7 soko-init-long-wall "  "  "@ "  "##
  676.            newline-and-indent goto 8 set soko-cmd 6 soko-init-long-wall
  677.            close-fold
  678.            next-line
  679.            ;OCL}}}
  680.            ;OCL{{{  28
  681.            goto 1 create-fold create-fold
  682.            open-fold
  683.            newline-and-indent goto 10 set soko-cmd 5 soko-init-long-wall
  684.            newline-and-indent goto 6 set soko-cmd 5 soko-init-long-wall "  "  "  "#
  685.            newline-and-indent goto 5 "## "  "$ "  "  "$ "  "  "####
  686.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall "  "$ "  "  "$ "  "$ "  "##.#
  687.            newline-and-indent goto 1 "# goto 9 "$$ "  "  "##..#
  688.            newline-and-indent goto 1 "# "  "  set soko-cmd 6 soko-init-long-wall "  "###.. "  "#
  689.            newline-and-indent goto 1 "## "  "# "  "  "# "  "  "  "  "#... "  "#
  690.            newline-and-indent goto 1 "# "  "$ "  "  "  "# "  "  "  "  "#... "  "#
  691.            newline-and-indent goto 1 "#@ "  "#$ "  "## "  "####...#
  692.            newline-and-indent goto 1 "#### "  "  "$ "  "$$ "  "  "##..#
  693.            newline-and-indent goto 4 "## "  "  "$ "  "$ "  "  "$...#
  694.            newline-and-indent goto 5 "# "  "$$ "  "  "$ "  "# "  "  ".#
  695.            newline-and-indent goto 5 "# "  "  "  "$ "  "$ "  "  "####
  696.            newline-and-indent goto 5 set soko-cmd 6 soko-init-long-wall "  "  "  "#
  697.            newline-and-indent goto 10 set soko-cmd 5 soko-init-long-wall
  698.            close-fold
  699.            next-line
  700.            ;OCL}}}
  701.            ;OCL{{{  29
  702.            goto 1 create-fold create-fold
  703.            open-fold
  704.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall
  705.            newline-and-indent goto 1 "# "  "  "  "##
  706.            newline-and-indent goto 1 "# "  "$ "  "  set soko-cmd 9 soko-init-long-wall
  707.            newline-and-indent goto 1 "## "  "# "  "# goto 14 set soko-cmd 6 soko-init-long-wall
  708.            newline-and-indent goto 1 "## "  "# "  "  "  "$#$#@ "  "  "# "  "  "  "#
  709.            newline-and-indent goto 1 "# "  "  "# goto 11 "$ "  "# "  "  "  "$ "  "#
  710.            newline-and-indent goto 1 "# "  "  "### "  set soko-cmd 9 soko-init-long-wall "  "##
  711.            newline-and-indent goto 1 "# "  "  "## "  "..*..... "  "# "  "##
  712.            newline-and-indent goto 1 "## "  "## "  "*.*..*.* "  "# "  "##
  713.            newline-and-indent goto 1 "# "  "$ set soko-cmd 10 soko-init-long-wall "  "##$ "  "#
  714.            newline-and-indent goto 1 "# "  "  "$ "  "  "  "$ "  "  "$ "  "  "  "  "$ "  "  "#
  715.            newline-and-indent goto 1 "# "  "  "# "  "  "  "# "  "  "  "# "  "  "  "# "  "  "#
  716.            newline-and-indent goto 1 set soko-cmd 19 soko-init-long-wall
  717.            close-fold
  718.            next-line
  719.            ;OCL}}}
  720.            ;OCL{{{  30
  721.            goto 1 create-fold create-fold
  722.            open-fold
  723.            newline-and-indent goto 8 set soko-cmd 11 soko-init-long-wall
  724.            newline-and-indent goto 8 "# "  "  "  "# "  "  "  "  "  "#
  725.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall "  "  "# "  "  "  "  "  "$ "  "$ "  "#
  726.            newline-and-indent goto 1 "# "  "  "  set soko-cmd 5 soko-init-long-wall "  "$## "  "# "  "##
  727.            newline-and-indent goto 1 "# "  "$ "  "## "  "  "  "# "  "## "  "$ "  "  "#
  728.            newline-and-indent goto 1 "# "  "$ "  "  "@$$ "  "# "  "##$$ "$ "  "#
  729.            newline-and-indent goto 1 "## "  "### "  "  "  "# "  "## "  "  "  "  "#
  730.            newline-and-indent goto 1 "## "  "# "  "  "  "### "  set soko-cmd 5 soko-init-long-wall "$#
  731.            newline-and-indent goto 1 "## "  "# "  "  "  "  "  "$ "  "  "#....#
  732.            newline-and-indent goto 1 "# "  "  "### "  "## "  "$ "  "#....##
  733.            newline-and-indent goto 1 "# "  "$ "  "  "  "$ "  "# "  "  "  "#..$. "  "#
  734.            newline-and-indent goto 1 "# "  "  "## "  "$ "  "# "  "  "##.... "  "#
  735.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall "  "  "  set soko-cmd 6 soko-init-long-wall "...##
  736.            newline-and-indent goto 5 set soko-cmd 5 soko-init-long-wall "  "  "  "  set soko-cmd 5 soko-init-long-wall
  737.            close-fold
  738.            next-line
  739.            ;OCL}}}
  740.          )
  741.       )
  742.       ;OCL}}}
  743.       ;OCL{{{  soko-init-board-4
  744.       ( deffun soko-init-board-4
  745.          (
  746.            ;OCL{{{  31
  747.            goto 1 create-fold create-fold
  748.            open-fold
  749.            newline-and-indent goto 3 "####
  750.            newline-and-indent goto 3 "# "  "  set soko-cmd 9 soko-init-long-wall
  751.            newline-and-indent goto 2 "## "  "  "## "  "  "# "  "  "  "#
  752.            newline-and-indent goto 2 "# "  "  "$# "  "$@$ "  "  "  "####
  753.            newline-and-indent goto 2 "#$ "  "  "$ "  "  "# "  "$ "  "$# "  "  "##
  754.            newline-and-indent goto 1 "## "  "  "$## "  "#$ "  "$ "  "  "  "  "  "#
  755.            newline-and-indent goto 1 "# "  "  "# "  "  "# "  "# "  "  "  "$$ "$ "  "  "#
  756.            newline-and-indent goto 1 "# "  "$ "  "  "  "  "$ "  "  "$## "  "####
  757.            newline-and-indent goto 1 "# "  "$ "  "$ "  "#$# "  "  "# "  "  "#
  758.            newline-and-indent goto 1 "## "  "  "### "  "  "###$ "  "#
  759.            newline-and-indent goto 2 "# "  "  "#.... "  "  "  "  "  "#
  760.            newline-and-indent goto 2 "####......####
  761.            newline-and-indent goto 4 "#....####
  762.            newline-and-indent goto 4 "#...##
  763.            newline-and-indent goto 4 "#...#
  764.            newline-and-indent goto 4 set soko-cmd 5 soko-init-long-wall
  765.            close-fold
  766.            next-line
  767.            ;OCL}}}
  768.            ;OCL{{{  32
  769.            goto 1 create-fold create-fold
  770.            open-fold
  771.            newline-and-indent goto 7 "####
  772.            newline-and-indent goto 3 set soko-cmd 5 soko-init-long-wall "  "  "#
  773.            newline-and-indent goto 2 "## "  "  "  "  "  "$#
  774.            newline-and-indent goto 1 "## "  "$ "  "  "## "  "###
  775.            newline-and-indent goto 1 "#@$ "  "$ "  "# "  "$ "  "  "#
  776.            newline-and-indent goto 1 "#### "  "## "  "  "  "$#
  777.            newline-and-indent goto 2 "#....#$ "  "$ "  "#
  778.            newline-and-indent goto 2 "#....# "  "  "  "$#
  779.            newline-and-indent goto 2 "#.... "  "  "$$ "  "##
  780.            newline-and-indent goto 2 "#... "  "# "  "$ "  "  "  "#
  781.            newline-and-indent goto 2 set soko-cmd 6 soko-init-long-wall "$ "  "$ "  "  "#
  782.            newline-and-indent goto 7 "# "  "  "  "###
  783.            newline-and-indent goto 7 "#$ "  "###
  784.            newline-and-indent goto 7 "# "  "  "#
  785.            newline-and-indent goto 7 "####
  786.            close-fold
  787.            next-line
  788.            ;OCL}}}
  789.            ;OCL{{{  33
  790.            goto 1 create-fold create-fold
  791.            open-fold
  792.            newline-and-indent goto 1 set soko-cmd 12 soko-init-long-wall
  793.            newline-and-indent goto 1 "## "  "  "  "  "  "## "  "  "#
  794.            newline-and-indent goto 1 "## "  "  "  "$ "  "  "  "$ "  "#
  795.            newline-and-indent goto 1 "#### "  "## "  "$$ "  "#
  796.            newline-and-indent goto 1 "# "  "  "  "$ "  "# "  "  "  "  "#
  797.            newline-and-indent goto 1 "# "  "$$ "$ "  "# "  "####
  798.            newline-and-indent goto 1 "# "  "  "  "# "  "# "  "$ "  "##
  799.            newline-and-indent goto 1 "# "  "  "# "  "  "# "  "  "$ "  "#
  800.            newline-and-indent goto 1 "# "  "$# "  "$# "  "  "  "  "#
  801.            newline-and-indent goto 1 "# "  "  "  "..# "  "####
  802.            newline-and-indent goto 1 "####.. "  "$ "  "#@#
  803.            newline-and-indent goto 1 "#.....# "  "$# "  "#
  804.            newline-and-indent goto 1 "##....# "  "  "$ "  "#
  805.            newline-and-indent goto 1 "###..## "  "  "  "  "#
  806.            newline-and-indent goto 1 set soko-cmd 12 soko-init-long-wall
  807.            close-fold
  808.            next-line
  809.            ;OCL}}}
  810.            ;OCL{{{  34
  811.            goto 1 create-fold create-fold
  812.            open-fold
  813.            newline-and-indent goto 2 set soko-cmd 9 soko-init-long-wall
  814.            newline-and-indent goto 2 "#.... "  "  "  "##
  815.            newline-and-indent goto 2 "#.#.# "  "  "$ "  "##
  816.            newline-and-indent goto 1 "##....# "  "# "  "@##
  817.            newline-and-indent goto 1 "# "  "....# "  "  "# "  "  "##
  818.            newline-and-indent goto 1 "# "  "  "  "  "  "#$ "  "##$ "  "#
  819.            newline-and-indent goto 1 "## "  "### "  "  "$ "  "  "  "  "#
  820.            newline-and-indent goto 2 "#$ "  "  "$ "  "$ "  "$# "  "  "#
  821.            newline-and-indent goto 2 "# "  "# "  "  "$ "  "$ "  "## "  "#
  822.            newline-and-indent goto 2 "# "  "  "### "  "  "## "  "  "#
  823.            newline-and-indent goto 2 "# "  "  "  "  "## "  "## "  "##
  824.            newline-and-indent goto 2 "# "  "  "$ "  "# "  "  "$ "  "  "#
  825.            newline-and-indent goto 2 "###$ "  "$ "  "  "  "###
  826.            newline-and-indent goto 4 "# "  "  set soko-cmd 5 soko-init-long-wall
  827.            newline-and-indent goto 4 "####
  828.            close-fold
  829.            next-line
  830.            ;OCL}}}
  831.            ;OCL{{{  35
  832.            goto 1 create-fold create-fold
  833.            open-fold
  834.            newline-and-indent goto 1 set soko-cmd 12 soko-init-long-wall "  set soko-cmd 6 soko-init-long-wall
  835.            newline-and-indent goto 1 "# "  "  "  "# "  "  "  "  "# "  "###....#
  836.            newline-and-indent goto 1 "# "  "  "  "$$ "# "  "  "  "@ "  "  ".....#
  837.            newline-and-indent goto 1 "# "  "  "  "# "  "### "  "  "  "# "  "....#
  838.            newline-and-indent goto 1 "## "  "## "  "### "  "  "# "  "  "....#
  839.            newline-and-indent goto 2 "# "  "$ "  "$ "  "  "  "  "  "# "  "# "  "####
  840.            newline-and-indent goto 2 "# "  "  "$ "  "$## "  "  "# goto 19 "#
  841.            newline-and-indent goto 1 "#### "  "# "  "  "#### "  "# "  "## "  "#
  842.            newline-and-indent goto 1 "# "  "  "# "  "#$ "  "  "  "## "  "# "  "  "  "  "#
  843.            newline-and-indent goto 1 "# "  "$ "  "  "$ "  "  "# "  "## "  "# "  "  "  "##
  844.            newline-and-indent goto 1 "# "  "# "  "$ "  "$ "  "  "  "  "# "  "# "  "  "  "#
  845.            newline-and-indent goto 1 "# "  "  "$ "  "## "  "## "  "# "  set soko-cmd 5 soko-init-long-wall
  846.            newline-and-indent goto 1 "# "  "$$ "  "  "  "  "  "$$ "  "  "#
  847.            newline-and-indent goto 1 "## "  "## "  "### "  "$ "  "  "#
  848.            newline-and-indent goto 2 "# "  "  "  "  "# "  "# "  "  "  "  "#
  849.            newline-and-indent goto 2 set soko-cmd 6 soko-init-long-wall "  set soko-cmd 6 soko-init-long-wall
  850.            close-fold
  851.            next-line
  852.            ;OCL}}}
  853.            ;OCL{{{  36
  854.            goto 1 create-fold create-fold
  855.            open-fold
  856.            newline-and-indent goto 13 set soko-cmd 5 soko-init-long-wall
  857.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall "  "  set soko-cmd 6 soko-init-long-wall "  "  "  "#
  858.            newline-and-indent goto 1 "# "  "  "  "#### "  "  "$ "  "$ "  "$ "  "#
  859.            newline-and-indent goto 1 "# "  "$ "  "  "  "## "  "## "  "## "  "  "##
  860.            newline-and-indent goto 1 "# "  "  "  "$ "  "$ "  "  "  "  "  "$ "  "  "$ "  "#
  861.            newline-and-indent goto 1 "### "  "$ "  "  "## "  "## "  "  "  "  "  "##
  862.            newline-and-indent goto 3 "# "  set soko-cmd 5 soko-init-long-wall "  set soko-cmd 5 soko-init-long-wall "$$ "  "#
  863.            newline-and-indent goto 2 "##$ set soko-cmd 5 soko-init-long-wall "  "@## "  "  "  "  "  "#
  864.            newline-and-indent goto 2 "# "  "$ "  "  "###$### "  "$ "  "  "##
  865.            newline-and-indent goto 2 "# "  "$ "  "  "# "  "  "  "### "  "  "###
  866.            newline-and-indent goto 2 "# "  "$$ "  "$ "  "# "  "  "  "$$ "  "#
  867.            newline-and-indent goto 2 "# "  "  "  "  "  "# "  "  "  "## "  "  "#
  868.            newline-and-indent goto 2 set soko-cmd 7 soko-init-long-wall ".. "  ".###
  869.            newline-and-indent goto 5 "#.........#
  870.            double-line
  871.            newline-and-indent goto 5 set soko-cmd 11 soko-init-long-wall
  872.            close-fold
  873.            next-line
  874.            ;OCL}}}
  875.            ;OCL{{{  37
  876.            goto 1 create-fold create-fold
  877.            open-fold
  878.            newline-and-indent goto 1 set soko-cmd 11 soko-init-long-wall
  879.            newline-and-indent goto 1 "#...... "  "  "  set soko-cmd 9 soko-init-long-wall
  880.            newline-and-indent goto 1 "#...... "  "  "  "# "  "  "## "  "  "  "#
  881.            newline-and-indent goto 1 "#..### "  "$ "  "  "  "  "$ "  "  "  "  "  "#
  882.            newline-and-indent goto 1 "#... "  "$ "  "$ "  "# "  "  "  "## "  "  "  "#
  883.            newline-and-indent goto 1 "#...#$ set soko-cmd 5 soko-init-long-wall "  "  "  "  "# "  "  "#
  884.            newline-and-indent goto 1 "### "  "  "  "  "# "  "  "  "#$ "  "  "#$ "  "#
  885.            newline-and-indent goto 3 "# "  "  "$$ "  "$ "  "$ "  "  "$## "  "  "#
  886.            newline-and-indent goto 3 "# "  "  "$ "  "  "  "#$#$ "  "##$ "  "#
  887.            newline-and-indent goto 3 "### "  "## "  "# "  "  "  "  "## "  "  "#
  888.            newline-and-indent goto 4 "# "  "  "$ "  "$ "  "## "  set soko-cmd 6 soko-init-long-wall
  889.            newline-and-indent goto 4 "# "  "  "  "  "$ "  "  "$ "  "  "#
  890.            newline-and-indent goto 4 "## "  "  "  "# "  "# "  "  "  "#
  891.            newline-and-indent goto 5 set soko-cmd 5 soko-init-long-wall "@ set soko-cmd 5 soko-init-long-wall
  892.            newline-and-indent goto 9 "###
  893.            close-fold
  894.            next-line
  895.            ;OCL}}}
  896.            ;OCL{{{  38
  897.            goto 1 create-fold create-fold
  898.            open-fold
  899.            newline-and-indent goto 7 "####
  900.            newline-and-indent goto 1 set soko-cmd 7 soko-init-long-wall "  "@#
  901.            newline-and-indent goto 1 "# "  "  "  "  "  "$ "  "  "#
  902.            newline-and-indent goto 1 "# "  "  "  "$## "  "$#
  903.            newline-and-indent goto 1 "##$#...# "  "#
  904.            newline-and-indent goto 2 "# "  "$... "  "  "#
  905.            newline-and-indent goto 2 "# "  "#. "  ".# "  "##
  906.            newline-and-indent goto 2 "# "  "  "  "# "  "#$ "  "#
  907.            newline-and-indent goto 2 "#$ "  "  "$ "  "  "  "  "#
  908.            newline-and-indent goto 2 "# "  "  set soko-cmd 7 soko-init-long-wall
  909.            newline-and-indent goto 2 "####
  910.            close-fold
  911.            next-line
  912.            ;OCL}}}
  913.            ;OCL{{{  39
  914.            goto 1 create-fold create-fold
  915.            open-fold
  916.            newline-and-indent goto 14 set soko-cmd 6 soko-init-long-wall
  917.            newline-and-indent goto 2 set soko-cmd 13 soko-init-long-wall "....#
  918.            newline-and-indent goto 1 "## "  "  "  "## "  "  "  "  "  "##....#
  919.            newline-and-indent goto 1 "# "  "  "$$ "## "  "  "$ "  "@##....#
  920.            newline-and-indent goto 1 "# goto 8 "$$ "  "$# "  "  "....#
  921.            newline-and-indent goto 1 "# "  "  "$ "  "## "  "$$ "  "# "  "# "  "...#
  922.            newline-and-indent goto 1 "# "  "  "$ "  "## "  "$ "  "  "# "  "  "....#
  923.            newline-and-indent goto 1 "## "  set soko-cmd 5 soko-init-long-wall "  "### "  "##.###
  924.            newline-and-indent goto 1 "## "  "  "  "$ "  "  "$ "  "## "  "  "  ". "  "  "#
  925.            newline-and-indent goto 1 "# "  "$### "  "  "# "  set soko-cmd 5 soko-init-long-wall "  "###
  926.            newline-and-indent goto 1 "# "  "  "  "$ "  "  "  "# goto 17 "#
  927.            newline-and-indent goto 1 "# "  "  "$ "  "#$ "  "$ "  "$### "  "  "#
  928.            newline-and-indent goto 1 "# "  "$$ "$# "  "$ "  "  "  "# "  "####
  929.            newline-and-indent goto 1 "# "  "  "  "  "# "  "  "$$ "  "#
  930.            newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall "  "  "  "###
  931.            newline-and-indent goto 6 set soko-cmd 5 soko-init-long-wall
  932.            close-fold
  933.            next-line
  934.            ;OCL}}}
  935.          )
  936.       )
  937.       ;OCL}}}
  938.       ;OCL{{{  soko-init-board-5
  939.       ( deffun soko-init-board-5
  940.          (
  941.            ;OCL{{{  40
  942.            goto 1 create-fold create-fold
  943.            open-fold
  944.            newline-and-indent goto 5 set soko-cmd 12 soko-init-long-wall
  945.            newline-and-indent goto 5 "# goto 16 "##
  946.            newline-and-indent goto 5 "# "  "  "# "  "#$$ "  "$ "  "  "#
  947.            newline-and-indent goto 5 "#$ "  "#$# "  "  "## "  "@#
  948.            newline-and-indent goto 4 "## "  "## "  "# "  "$ "  "# "  "##
  949.            newline-and-indent goto 4 "# "  "  "  "$ "  "#$ "  "  "# "  "#
  950.            newline-and-indent goto 4 "# "  "  "  "# "  "$ "  "  "  "# "  "#
  951.            newline-and-indent goto 4 "## "  "$ "  "$ "  "  "  "## "  "#
  952.            newline-and-indent goto 4 "# "  "  "# "  "  "## "  "  "$ "  "#
  953.            newline-and-indent goto 4 "# "  "  "  "  "## "  "$$ "# "  "#
  954.            newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall "$$ "  "  "  "# "  "  "  "#
  955.            newline-and-indent goto 1 "#....# "  "  set soko-cmd 8 soko-init-long-wall
  956.            newline-and-indent goto 1 "#.#... "  "##
  957.            newline-and-indent goto 1 "#.... "  "  "  "#
  958.            double-line
  959.            newline-and-indent goto 1 set soko-cmd 9 soko-init-long-wall
  960.            close-fold
  961.            next-line
  962.            ;OCL}}}
  963.            ;OCL{{{  41
  964.            goto 1 create-fold create-fold
  965.            open-fold
  966.            newline-and-indent goto 12 set soko-cmd 5 soko-init-long-wall
  967.            newline-and-indent goto 11 "## "  "  "  "##
  968.            newline-and-indent goto 10 "## "  "  "  "  "  "#
  969.            newline-and-indent goto 9 "## "  "  "$$ "  "  "#
  970.            newline-and-indent goto 8 "## "  "$$ "  "  "$ "  "#
  971.            newline-and-indent goto 8 "# "  "$ "  "  "  "  "$ "  "#
  972.            newline-and-indent goto 1 "#### "  "  "  "# "  "  "  "$$ "  set soko-cmd 5 soko-init-long-wall
  973.            newline-and-indent goto 1 "# "  "  set soko-cmd 8 soko-init-long-wall "  "## "  "  "  "  "#
  974.            newline-and-indent goto 1 "#. goto 15 "$$ "$@#
  975.            newline-and-indent goto 1 "#.# "  set soko-cmd 7 soko-init-long-wall "  "## "  "  "  "##
  976.            newline-and-indent goto 1 "#.# "  set soko-cmd 7 soko-init-long-wall ". "  "#$ "  "$##
  977.            newline-and-indent goto 1 "#........... "  "# "  "  "  "  "#
  978.            newline-and-indent goto 1 set soko-cmd 14 soko-init-long-wall "  "  "$ "  "#
  979.            newline-and-indent goto 14 "## "  "  "##
  980.            newline-and-indent goto 15 "####
  981.            close-fold
  982.            next-line
  983.            ;OCL}}}
  984.            ;OCL{{{  42
  985.            goto 1 create-fold create-fold
  986.            open-fold
  987.            newline-and-indent goto 6 set soko-cmd 8 soko-init-long-wall
  988.            newline-and-indent goto 3 "#### goto 13 set soko-cmd 6 soko-init-long-wall
  989.            newline-and-indent goto 3 "# "  "  "  "  "## "  "$ "  "$ "  "  "  "@#
  990.            newline-and-indent goto 3 "# "  "## "  "##$#$ "  "$ "  "$##
  991.            newline-and-indent goto 1 "### "  "......# "  "  "$$ "  "##
  992.            newline-and-indent goto 1 "# "  "  "  "......# "  "  "# "  "  "  "#
  993.            newline-and-indent goto 1 "# "  "# "  "......#$ "  "  "$ "  "  "#
  994.            newline-and-indent goto 1 "# "  "#$...... "  "$$ "# "  "$ "  "#
  995.            newline-and-indent goto 1 "# "  "  "  "### "  "###$ "  "  "$ "  "##
  996.            newline-and-indent goto 1 "### "  "  "$ "  "  "$ "  "  "$ "  "  "$ "  "#
  997.            newline-and-indent goto 3 "# "  "  "$ "  "  "$ "  "  "$ "  "  "$ "  "#
  998.            newline-and-indent goto 3 set soko-cmd 6 soko-init-long-wall "  "  "  set soko-cmd 6 soko-init-long-wall
  999.            newline-and-indent goto 8 set soko-cmd 5 soko-init-long-wall
  1000.            close-fold
  1001.            next-line
  1002.            ;OCL}}}
  1003.            ;OCL{{{  43
  1004.            goto 1 create-fold create-fold
  1005.            open-fold
  1006.            newline-and-indent goto 9 set soko-cmd 7 soko-init-long-wall
  1007.            newline-and-indent goto 5 set soko-cmd 5 soko-init-long-wall "  "  "# "  "  "####
  1008.            newline-and-indent goto 5 "# "  "  "  "# "  "  "  "$ "  "  "  "  "#
  1009.            newline-and-indent goto 2 "#### "  "#$$ "  "## "  "## "  "  "#
  1010.            newline-and-indent goto 1 "## goto 9 "# "  "# "  "  "## "  "###
  1011.            newline-and-indent goto 1 "# "  "  "### "  "$#$ "  "  "$ "  "  "$ "  "  "#
  1012.            newline-and-indent goto 1 "#... "  "  "  "  "# "  "## "  "  "# "  "  "  "#
  1013.            newline-and-indent goto 1 "#...# "  "  "  "  "@ "  "# "  "### "  "##
  1014.            newline-and-indent goto 1 "#...# "  "  "### "  "  "$ "  "  "$ "  "  "#
  1015.            newline-and-indent goto 1 set soko-cmd 8 soko-init-long-wall "  "## "  "  "  "# "  "  "  "#
  1016.            newline-and-indent goto 11 set soko-cmd 9 soko-init-long-wall
  1017.            close-fold
  1018.            next-line
  1019.            ;OCL}}}
  1020.            ;OCL{{{  44
  1021.            goto 1 create-fold create-fold
  1022.            open-fold
  1023.            newline-and-indent goto 2 set soko-cmd 5 soko-init-long-wall
  1024.            newline-and-indent goto 2 "# "  "  "  "#
  1025.            newline-and-indent goto 2 "# "  "# "  set soko-cmd 7 soko-init-long-wall
  1026.            newline-and-indent goto 2 "# goto 9 "$@ set soko-cmd 6 soko-init-long-wall
  1027.            newline-and-indent goto 2 "# "  "$ "  "##$ "  "### "  "  "  "#
  1028.            newline-and-indent goto 2 "# "  "#### "  "$ "  "  "  "  "$ "  "#
  1029.            newline-and-indent goto 2 "# "  set soko-cmd 5 soko-init-long-wall "  "# "  "  "#$ "  "####
  1030.            newline-and-indent goto 1 "## "  "  "#### "  "##$ goto 19 "#
  1031.            newline-and-indent goto 1 "# "  "  "$# "  "  "$ "  "  "# "  "## "  "## "  "#
  1032.            newline-and-indent goto 1 "# goto 11 "# "  "#...# "  "#
  1033.            newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall "  "  "### "  "  "... "  "  "#
  1034.            newline-and-indent goto 6 "#### "  "# "  "#...# "  "#
  1035.            newline-and-indent goto 11 "# "  "### "  "# "  "#
  1036.            newline-and-indent goto 11 "# goto 19 "#
  1037.            newline-and-indent goto 11 set soko-cmd 9 soko-init-long-wall
  1038.            close-fold
  1039.            next-line
  1040.            ;OCL}}}
  1041.            ;OCL{{{  45
  1042.            goto 1 create-fold create-fold
  1043.            open-fold
  1044.            newline-and-indent goto 1 set soko-cmd 5 soko-init-long-wall "  "####
  1045.            newline-and-indent goto 1 "#...# "  "# "  "  "####
  1046.            newline-and-indent goto 1 "#...### "  "  "$ "  "  "#
  1047.            newline-and-indent goto 1 "#....## "  "$ "  "  "$###
  1048.            newline-and-indent goto 1 "##....## "  "  "  "$ "  "  "#
  1049.            newline-and-indent goto 1 "###... "  "## "  "$ "  "$ "  "#
  1050.            newline-and-indent goto 1 "# "  "## "  "  "  "  "# "  "  "$ "  "  "#
  1051.            newline-and-indent goto 1 "# "  "  "## "  "# "  "### "  "####
  1052.            newline-and-indent goto 1 "# "  "$ "  "# "  "#$ "  "  "$ "  "  "  "  "#
  1053.            newline-and-indent goto 1 "# "  "  "$ "  "@ "  "$ "  "  "  "  "$ "  "  "#
  1054.            newline-and-indent goto 1 "# "  "  "  "# "  "$ "  "$$ "  "$ "  "###
  1055.            newline-and-indent goto 1 "# "  "  set soko-cmd 6 soko-init-long-wall "  "  "###
  1056.            newline-and-indent goto 1 "# "  "## "  "  "  "  "####
  1057.            newline-and-indent goto 1 "###
  1058.            close-fold
  1059.            next-line
  1060.            ;OCL}}}
  1061.            ;OCL{{{  46
  1062.            goto 1 create-fold create-fold
  1063.            open-fold
  1064.            newline-and-indent goto 1 set soko-cmd 10 soko-init-long-wall
  1065.            newline-and-indent goto 1 "# goto 10 "####
  1066.            newline-and-indent goto 1 "# "  set soko-cmd 6 soko-init-long-wall "  "# "  "  "##
  1067.            newline-and-indent goto 1 "# "  "# "  "$ "  "$ "  "$ "  "  "$ "  "#
  1068.            newline-and-indent goto 1 "# goto 9 "#$ "  "  "  "#
  1069.            newline-and-indent goto 1 "###$ "  "  "$$ "# "  "  "###
  1070.            newline-and-indent goto 3 "# "  "  "## "  "# "  "$##
  1071.            newline-and-indent goto 3 "##$# "  "  "  "$ "  "@#
  1072.            newline-and-indent goto 4 "# "  "  "$ "  "$ "  "###
  1073.            newline-and-indent goto 4 "# "  "# "  "  "  "$ "  "  "#
  1074.            newline-and-indent goto 4 "# "  "## "  "  "  "# "  "#
  1075.            newline-and-indent goto 3 "## "  "  set soko-cmd 5 soko-init-long-wall "  "#
  1076.            newline-and-indent goto 3 "# goto 13 "#
  1077.            newline-and-indent goto 3 "#.......###
  1078.            newline-and-indent goto 3 "#.......#
  1079.            newline-and-indent goto 3 set soko-cmd 9 soko-init-long-wall
  1080.            close-fold
  1081.            next-line
  1082.            ;OCL}}}
  1083.            ;OCL{{{  47
  1084.            goto 1 create-fold create-fold
  1085.            open-fold
  1086.            newline-and-indent goto 10 "####
  1087.            newline-and-indent goto 2 set soko-cmd 9 soko-init-long-wall "  "  "##
  1088.            newline-and-indent goto 1 "## "  "  "$ goto 12 "$ "  set soko-cmd 5 soko-init-long-wall
  1089.            newline-and-indent goto 1 "# "  "  "  "## "  "## "  "  "  "##...#
  1090.            newline-and-indent goto 1 "# "  "#$$ "  "$ "  "$$ "#$##...#
  1091.            newline-and-indent goto 1 "# "  "# "  "  "  "@ "  "  "  "# "  "  "  "...#
  1092.            newline-and-indent goto 1 "# "  "  "$# "  "###$$ "  "  "  "...#
  1093.            newline-and-indent goto 1 "# "  "$ "  "  "$$ "  "  "$ "  "##....#
  1094.            newline-and-indent goto 1 "###$ goto 12 set soko-cmd 7 soko-init-long-wall
  1095.            newline-and-indent goto 3 "# "  "  set soko-cmd 7 soko-init-long-wall
  1096.            newline-and-indent goto 3 "####
  1097.            close-fold
  1098.            next-line
  1099.            ;OCL}}}
  1100.            ;OCL{{{  48
  1101.            goto 1 create-fold create-fold
  1102.            open-fold
  1103.            newline-and-indent goto 3 set soko-cmd 9 soko-init-long-wall
  1104.            newline-and-indent goto 3 "#*.*#*.*#
  1105.            newline-and-indent goto 3 "#.*.*.*.#
  1106.            newline-and-indent goto 3 "#*.*.*.*#
  1107.            newline-and-indent goto 3 "#.*.*.*.#
  1108.            newline-and-indent goto 3 "#*.*.*.*#
  1109.            newline-and-indent goto 3 "### "  "  "  "###
  1110.            newline-and-indent goto 5 "# "  "  "  "#
  1111.            newline-and-indent goto 1 set soko-cmd 6 soko-init-long-wall "  set soko-cmd 6 soko-init-long-wall
  1112.            newline-and-indent goto 1 "# goto 13 "#
  1113.            newline-and-indent goto 1 "# "  "$ "  "$ "  "$ "  "$ "  "$ "  "#
  1114.            newline-and-indent goto 1 "## "  "$ "  "$ "  "$ "  "$ "  "##
  1115.            newline-and-indent goto 2 "#$ "  "$ "  "$ "  "$ "  "$#
  1116.            newline-and-indent goto 2 "# "  "  "  "$@$ "  "  "  "#
  1117.            newline-and-indent goto 2 "# "  "  set soko-cmd 5 soko-init-long-wall "  "  "#
  1118.            newline-and-indent goto 2 "#### "  "  "  "####
  1119.            close-fold
  1120.            next-line
  1121.            ;OCL}}}
  1122.            ;OCL{{{  49
  1123.            goto 1 create-fold create-fold
  1124.            open-fold
  1125.            newline-and-indent goto 8 "####
  1126.            newline-and-indent goto 8 "# "  "  "##
  1127.            newline-and-indent goto 8 "# "  "  "  "##
  1128.            newline-and-indent goto 8 "# "  "$$ "  "##
  1129.            newline-and-indent goto 6 "###$ "  "  "$ "  "##
  1130.            newline-and-indent goto 3 "#### "  "  "  "  "$ "  "  "  "#
  1131.            newline-and-indent goto 1 "### "  "  "# "  set soko-cmd 5 soko-init-long-wall "  "  "#
  1132.            newline-and-indent goto 1 "# "  "  "  "  "# "  "#....$ "  "#
  1133.            newline-and-indent goto 1 "# "  "# "  "  "  "$ "  "....# "  "#
  1134.            newline-and-indent goto 1 "# "  "  "$ "  "# "  "#.*..# "  "#
  1135.            newline-and-indent goto 1 "### "  "  "#### "  "### "  "#
  1136.            newline-and-indent goto 3 "#### "  "@$ "  "  "##$##
  1137.            newline-and-indent goto 6 "### "  "$ "  "  "  "  "  "#
  1138.            newline-and-indent goto 8 "# "  "  "## "  "  "  "#
  1139.            newline-and-indent goto 8 set soko-cmd 9 soko-init-long-wall
  1140.            close-fold
  1141.            next-line
  1142.            ;OCL}}}
  1143.            ;OCL{{{  50
  1144.            goto 1 create-fold create-fold
  1145.            open-fold
  1146.            newline-and-indent goto 7 set soko-cmd 12 soko-init-long-wall
  1147.            newline-and-indent goto 6 "##.. "  "  "  "  "# "  "  "  "#
  1148.            newline-and-indent goto 5 "##..* "  "$ "  "  "  "  "$ "  "#
  1149.            newline-and-indent goto 4 "##..*.# "  "# "  "# "  "$##
  1150.            newline-and-indent goto 4 "#..*.# "  "# "  "# "  "$ "  "  "#
  1151.            newline-and-indent goto 1 "####...# "  "  "# "  "  "  "  "# "  "#
  1152.            newline-and-indent goto 1 "# "  "  "## "  "# goto 18 "#
  1153.            newline-and-indent goto 1 "# "  "@$ "  "$ "  "### "  "  "# "  "  "  "##
  1154.            newline-and-indent goto 1 "# "  "$ "  "  "  "$ "  "  "  "# "  "# "  "  "  "#
  1155.            newline-and-indent goto 1 "###$$ "  "  "  "# "  "# "  "# "  "# "  "#
  1156.            newline-and-indent goto 3 "# "  "  "  "$ "  "  "  "# "  "# "  set soko-cmd 5 soko-init-long-wall
  1157.            newline-and-indent goto 3 "# "  "$# "  set soko-cmd 5 soko-init-long-wall goto 19 "#
  1158.            newline-and-indent goto 3 "#$ "  "  "  "# "  "  "  "# "  "  "  "  "# "  "#
  1159.            newline-and-indent goto 3 "# "  "  "### "  "  "  "## "  "  "  "  "  "#
  1160.            newline-and-indent goto 3 "# "  "  "# goto 13 "# "  "  "  "  "##
  1161.            newline-and-indent goto 3 "#### goto 13 set soko-cmd 6 soko-init-long-wall
  1162.            close-fold
  1163.            next-line
  1164.            ;OCL}}}
  1165.          )
  1166.       )
  1167.       ;OCL}}}
  1168.  
  1169.       ;OCL{{{  soko-init-boards
  1170.       ( defmac soko-init-boards
  1171.          (
  1172.            ;OCL{{{  create the levels
  1173.            soko-init-board-1 load-function not(soko-init-board-1)
  1174.            soko-init-board-2 load-function not(soko-init-board-2)
  1175.            soko-init-board-3 load-function not(soko-init-board-3)
  1176.            soko-init-board-4 load-function not(soko-init-board-4)
  1177.            soko-init-board-5 load-function not(soko-init-board-5)
  1178.            load-function not(soko-init-long-wall)
  1179.            ;OCL}}}
  1180.            ;OCL{{{  generate the fold-labels
  1181.            set soko-cmd 0
  1182.            beginning-of-fold
  1183.            while pre ( next-line ) not( test-bottom )
  1184.             ( set soko-cmd +(soko-cmd 1)
  1185.               end-of-line
  1186.               "level. counter soko-cmd
  1187.             )
  1188.            ;OCL}}}
  1189.            if not(test-language Inmos) ( set-language Inmos ) fi
  1190.          )
  1191.       )
  1192.       ;OCL}}}
  1193.       ;OCL{{{  soko-init-unload
  1194.       ( defmac soko-init-unload
  1195.          ( load-function not
  1196.             ( soko-init-board-1
  1197.               soko-init-board-2
  1198.               soko-init-board-3
  1199.               soko-init-board-4
  1200.               soko-init-board-5
  1201.               soko-init-long-wall
  1202.             )
  1203.          )
  1204.       )
  1205.       ;OCL}}}
  1206.  
  1207.       ;OCL{{{  undeclares
  1208.       ( undeclare
  1209.          ( soko-init-board-1
  1210.            soko-init-board-2
  1211.            soko-init-board-3
  1212.            soko-init-board-4
  1213.            soko-init-board-5
  1214.            soko-init-long-wall
  1215.          )
  1216.       )
  1217.       ;OCL}}}
  1218.       ;OCL}}}
  1219.       ;OCL{{{  soko-quit
  1220.       ( deffun soko-quit
  1221.          ( set-file-unchanged
  1222.            exit-buffer
  1223.            set soko-play false
  1224.          )
  1225.       )
  1226.       ;OCL}}}
  1227.       ;OCL{{{  soko-next-level
  1228.       ( deffun soko-next-level
  1229.          ( screen-off
  1230.            exit-fold
  1231.            delete-line
  1232.            delete-line
  1233.            end-of-fold
  1234.            undo-delete-line
  1235.            save-file
  1236.            set soko-cmd soko-quit
  1237.            screen-on
  1238.          )
  1239.       )
  1240.       ;OCL}}}
  1241.       ;OCL{{{  soko-previous-level
  1242.       ( deffun soko-previous-level
  1243.          ( screen-off
  1244.            exit-fold
  1245.            delete-line
  1246.            end-of-fold
  1247.            previous-line
  1248.            delete-line
  1249.            goto-line-counter 1
  1250.            undo-delete-line
  1251.            save-file
  1252.            set soko-cmd soko-quit
  1253.            screen-on
  1254.          )
  1255.       )
  1256.       ;OCL}}}
  1257.       ;OCL{{{  soko-reset
  1258.       ( deffun soko-reset
  1259.          ( screen-off
  1260.            exit-fold
  1261.            if soko-saved
  1262.             ( undo-delete-line
  1263.               next-line
  1264.               delete-line
  1265.               previous-line
  1266.               double-line
  1267.               delete-line
  1268.               previous-line
  1269.               enter-fold
  1270.               repeat soko-saved-y ( next-line )
  1271.               goto soko-saved-x
  1272.               set soko-homes soko-saved-homes
  1273.               set soko-mv soko-saved-mv
  1274.               set soko-pu soko-saved-pu
  1275.             )
  1276.            else
  1277.             ( delete-line
  1278.               set soko-cmd soko-quit
  1279.             )
  1280.            fi
  1281.            screen-on
  1282.            redraw-display
  1283.          )
  1284.       )
  1285.       ;OCL}}}
  1286.       ;OCL{{{  soko-save
  1287.       ( deffun soko-save
  1288.          ( screen-off
  1289.            set soko-saved-x store-pos
  1290.            set soko-saved-y -(store-line 2)
  1291.            set soko-saved-homes soko-homes
  1292.            set soko-saved-mv soko-mv
  1293.            set soko-saved-pu soko-pu
  1294.            exit-fold
  1295.            double-line
  1296.            delete-line
  1297.            previous-line
  1298.            enter-fold
  1299.            set soko-saved true
  1300.            screen-on
  1301.            soko-reset
  1302.            message "Saved!
  1303.            show-cursor 10
  1304.          )
  1305.       )
  1306.       ;OCL}}}
  1307.       ;OCL{{{  soko-restart-level
  1308.       ( deffun soko-restart-level
  1309.          ( set soko-saved false
  1310.            soko-reset
  1311.          )
  1312.       )
  1313.       ;OCL}}}
  1314.       ;OCL{{{  soko-action
  1315.       ( deffun ( move i-move repeat-mode ) soko-action
  1316.          ( do
  1317.             ;OCL{{{  do a single move
  1318.             ( insert-ascii move
  1319.               case
  1320.                ;OCL{{{  base or ground -> moved ok
  1321.                ( or(test-char "  test-char ".)
  1322.                   ( set soko-mv +(soko-mv 1)
  1323.                     set soko-undo true
  1324.                     set soko-undo-push false
  1325.                     set soko-undo-move move
  1326.                     set soko-undo-i-move i-move
  1327.                   )
  1328.                )
  1329.                ;OCL}}}
  1330.                ;OCL{{{  stone -> stop or push
  1331.                ( or(test-char "$ test-char "S)
  1332.                   ( if <(repeat-mode 0)
  1333.                      ;OCL{{{  running stops!
  1334.                      ( insert-ascii i-move
  1335.                        set repeat-mode false
  1336.                      )
  1337.                      ;OCL}}}
  1338.                     else
  1339.                      ;OCL{{{  try to shift the block
  1340.                      ( insert-ascii move
  1341.                        case
  1342.                         ;OCL{{{  base or ground -> shift
  1343.                         ( or(test-char "  test-char ".)
  1344.                            (
  1345.                              ;OCL{{{  draw shifted stone
  1346.                              if test-char ".
  1347.                               ( set soko-homes -(soko-homes 1)
  1348.                                 "S
  1349.                                 if not(test-overwrite)
  1350.                                  ( forward-character
  1351.                                    delete-previous-character
  1352.                                  )
  1353.                                 fi
  1354.                                 backward-character
  1355.                               )
  1356.                              else
  1357.                               ( "$
  1358.                                 if not(test-overwrite)
  1359.                                  ( forward-character
  1360.                                    delete-previous-character
  1361.                                  )
  1362.                                 fi
  1363.                                 backward-character
  1364.                               )
  1365.                              fi
  1366.                              ;OCL}}}
  1367.                              insert-ascii i-move
  1368.                              ;OCL{{{  delete shifted stone
  1369.                              if test-char "S
  1370.                               ( set soko-homes +(soko-homes 1)
  1371.                                 ".
  1372.                                 if not(test-overwrite)
  1373.                                  ( forward-character
  1374.                                    delete-previous-character
  1375.                                  )
  1376.                                 fi
  1377.                                 backward-character
  1378.                               )
  1379.                              else
  1380.                               ( "  ;
  1381.                                 if not(test-overwrite)
  1382.                                  ( forward-character
  1383.                                    delete-previous-character
  1384.                                  )
  1385.                                 fi
  1386.                                 backward-character
  1387.                               )
  1388.                              fi
  1389.                              ;OCL}}}
  1390.                              set soko-mv +(soko-mv 1)
  1391.                              set soko-pu +(soko-pu 1)
  1392.                              set soko-undo true
  1393.                              set soko-undo-push true
  1394.                              set soko-undo-move move
  1395.                              set soko-undo-i-move i-move
  1396.                            )
  1397.                         )
  1398.                         ;OCL}}}
  1399.                        default
  1400.                         ;OCL{{{  failed
  1401.                         ( insert-ascii i-move
  1402.                           insert-ascii i-move
  1403.                           set repeat-mode false
  1404.                         )
  1405.                         ;OCL}}}
  1406.                        esac
  1407.                      )
  1408.                      ;OCL}}}
  1409.                     fi
  1410.                   )
  1411.                )
  1412.                ;OCL}}}
  1413.               default
  1414.                ;OCL{{{  failed
  1415.                ( insert-ascii i-move
  1416.                  set repeat-mode false
  1417.                )
  1418.                ;OCL}}}
  1419.               esac
  1420.             )
  1421.             ;OCL}}}
  1422.            while repeat-mode
  1423.            if =(soko-homes 0)
  1424.             ;OCL{{{  up to he next level!
  1425.             ( message ("Hip "  "Hip "  "Hurra!)
  1426.               show-cursor 20
  1427.               soko-next-level
  1428.             )
  1429.             ;OCL}}}
  1430.            fi
  1431.            sokoban-kbd
  1432.          )
  1433.       )
  1434.       ;OCL}}}
  1435.       ;OCL{{{  soko-undo-last-move
  1436.       ( deffun soko-undo-last-move
  1437.          ( if soko-undo
  1438.             ( if soko-undo-push
  1439.                ( insert-ascii soko-undo-move
  1440.                  insert-ascii soko-undo-move
  1441.                  soko-action(soko-undo-i-move soko-undo-move 0)
  1442.                  insert-ascii soko-undo-move ; soko-action stored the move!
  1443.                  insert-ascii soko-undo-move ; so don't use i-move!
  1444.                  set soko-mv -(soko-mv 2)
  1445.                  set soko-pu -(soko-pu 2)
  1446.                )
  1447.               else
  1448.                ( insert-ascii soko-undo-i-move
  1449.                  set soko-mv -(soko-mv 1)
  1450.                )
  1451.               fi
  1452.               set soko-undo false
  1453.             )
  1454.            fi
  1455.          )
  1456.       )
  1457.       ;OCL}}}
  1458.       ;OCL{{{  soko-describe-bindings
  1459.       ( deffun soko-describe-bindings
  1460.          ( sokoban-kbd
  1461.            describe-bindings
  1462.            while in-prompt
  1463.             ( begin-prompt-macro
  1464.               prompt-char-counter soko-cmd ()
  1465.               end-prompt-macro
  1466.               insert-ascii soko-cmd
  1467.             )
  1468.          )
  1469.       )
  1470.       ;OCL}}}
  1471.       ;OCL{{{  up
  1472.       ( deffun soko-go-or-push-up ( soko-action(previous-line next-line 0 ) ) )
  1473.       ( deffun soko-run-or-push-up ( soko-action(previous-line next-line 1 ) ) )
  1474.       ( deffun soko-run-up ( soko-action(previous-line next-line -1 ) ) )
  1475.       ;OCL}}}
  1476.       ;OCL{{{  down
  1477.       ( deffun soko-go-or-push-down ( soko-action(next-line previous-line 0 ) ) )
  1478.       ( deffun soko-run-or-push-down ( soko-action(next-line previous-line 1 ) ) )
  1479.       ( deffun soko-run-down ( soko-action(next-line previous-line -1 ) ) )
  1480.       ;OCL}}}
  1481.       ;OCL{{{  left
  1482.       ( deffun soko-go-or-push-left ( soko-action(backward-character forward-character 0 ) ) )
  1483.       ( deffun soko-run-or-push-left ( soko-action(backward-character forward-character 1 ) ) )
  1484.       ( deffun soko-run-left ( soko-action(backward-character forward-character -1 ) ) )
  1485.       ;OCL}}}
  1486.       ;OCL{{{  right
  1487.       ( deffun soko-go-or-push-right ( soko-action(forward-character backward-character 0 ) ) )
  1488.       ( deffun soko-run-or-push-right ( soko-action(forward-character backward-character 1 ) ) )
  1489.       ( deffun soko-run-right ( soko-action(forward-character backward-character -1 ) ) )
  1490.       ;OCL}}}
  1491.       ;OCL{{{  soko-unload
  1492.       ;OCL{{{  soko-unload-
  1493.       ( deffun soko-unload-
  1494.          ( soko-init-unload
  1495.            load-function not
  1496.             ( soko-quit
  1497.               soko-next-level
  1498.               soko-previous-level
  1499.               soko-save
  1500.               soko-reset
  1501.               soko-restart-level
  1502.               soko-action
  1503.               soko-undo-last-move
  1504.               soko-describe-bindings
  1505.               soko-go-or-push-up
  1506.               soko-run-or-push-up
  1507.               soko-run-up
  1508.               soko-go-or-push-down
  1509.               soko-run-or-push-down
  1510.               soko-run-down
  1511.               soko-go-or-push-left
  1512.               soko-run-or-push-left
  1513.               soko-run-left
  1514.               soko-go-or-push-right
  1515.               soko-run-or-push-right
  1516.               soko-run-right
  1517.             )
  1518.          )
  1519.       )
  1520.       ;OCL}}}
  1521.  
  1522.       ( defmac soko-unload
  1523.          ( soko-unload-
  1524.            load-function not(soko-unload-)
  1525.          )
  1526.       )
  1527.  
  1528.       ;OCL{{{  undeclares
  1529.       ( undeclare ( soko-unload- ) )
  1530.       ;OCL}}}
  1531.       ;OCL}}}
  1532.  
  1533.       ( deffun sokoban
  1534.          ( save-buffer-layout
  1535.            set soko-play true
  1536.            ;OCL{{{  open full window sized sokoban buffer
  1537.            screen-off
  1538.            open-buffer
  1539.               @if-using ( SOKOBAN-FILE )
  1540.                  SOKOBAN-FILE
  1541.               @fi
  1542.               @if-using not( SOKOBAN-FILE )
  1543.                  "~/.orisokoban
  1544.               @fi
  1545.               newline-and-indent
  1546.            full-size-buffer
  1547.            delete-mode-view
  1548.            delete-mode-hash-shift
  1549.            goto-line-counter 1
  1550.            if test-bottom
  1551.             ;OCL{{{  init my 50 predefined levels
  1552.             ( soko-init-boards
  1553.               save-file
  1554.             )
  1555.             ;OCL}}}
  1556.            fi
  1557.            screen-on
  1558.            ;OCL}}}
  1559.            ;OCL{{{  play loop
  1560.            do
  1561.             ( screen-off
  1562.               goto-line-counter 1
  1563.               double-line
  1564.               previous-line
  1565.               set soko-mv 0
  1566.               set soko-pu 0
  1567.               ;OCL{{{  save regexp state
  1568.               delete-mode-regular-expression
  1569.               set soko-regexp +(ocl-argument 1)
  1570.               ;OCL}}}
  1571.               ;OCL{{{  get bases
  1572.               enter-fold
  1573.               goto 1
  1574.               replace-string
  1575.                  ". newline-and-indent
  1576.                  ". newline-and-indent
  1577.               set soko-homes ocl-argument
  1578.               ;OCL}}}
  1579.               ;OCL{{{  mark saved pakets with S, instead of *
  1580.               exit-fold
  1581.               enter-fold
  1582.               goto 1
  1583.               replace-string
  1584.                  "* newline-and-indent
  1585.                  "S newline-and-indent
  1586.               ;OCL}}}
  1587.               ;OCL{{{  move to cursor and maybe correct bases
  1588.               exit-fold
  1589.               enter-fold
  1590.               goto 1
  1591.               replace-string
  1592.                  "@ newline-and-indent
  1593.                  "  newline-and-indent
  1594.               if =(0 ocl-argument)
  1595.                ( replace-string
  1596.                     "+ newline-and-indent
  1597.                     ". newline-and-indent
  1598.                  set soko-homes +(soko-homes 1)
  1599.                )
  1600.               fi
  1601.               backward-character
  1602.               ;OCL}}}
  1603.               ;OCL{{{  reset regexp state
  1604.               case
  1605.                ( =(2 soko-regexp) ( add-mode-basic-regular-expression ) )
  1606.                ( =(3 soko-regexp) ( add-mode-extended-regular-expression ) )
  1607.               esac
  1608.               set soko-regexp 0
  1609.               ;OCL}}}
  1610.               screen-on
  1611.               redraw-display
  1612.               set soko-undo false
  1613.               set soko-saved false
  1614.               do
  1615.                ( set-file-unchanged
  1616.                  message
  1617.                   (    "Moves: counter soko-mv
  1618.                     "  "Pushes: counter soko-pu
  1619.                     "  "  "  "Pakets "  "to "  "store: counter soko-homes
  1620.                   )
  1621.                  show-cursor 0
  1622.                  sokoban-kbd
  1623.                  prompt-char-counter soko-cmd ()
  1624.                  SOKOBAN-RESET-KBD
  1625.                  if >(soko-cmd no-operation) ( insert-ascii soko-cmd ) fi
  1626.                )
  1627.               while <>(soko-cmd soko-quit)
  1628.             )
  1629.            while soko-play
  1630.            ;OCL}}}
  1631.            soko-unload
  1632.            restore-buffer-layout
  1633.          )
  1634.       )
  1635.       ;OCL}}}
  1636.       ;OCL{{{  define sokoban play keyboard
  1637.       ( mode sokoban-kbd
  1638.          ;OCL{{{  up
  1639.          ( keybind soko-go-or-push-up ( "k ) )
  1640.          ( keybind soko-run-or-push-up ( "K ) )
  1641.          ( keybind soko-run-up ( C-K ) )
  1642.          ;OCL}}}
  1643.          ;OCL{{{  down
  1644.          ( keybind soko-go-or-push-down ( "j ) )
  1645.          ( keybind soko-run-or-push-down ( "J ) )
  1646.          ( keybind soko-run-down ( C-J ) )
  1647.          ;OCL}}}
  1648.          ;OCL{{{  left
  1649.          ( keybind soko-go-or-push-left ( "h ) )
  1650.          ( keybind soko-run-or-push-left ( "H ) )
  1651.          ( keybind soko-run-left ( C-H ) )
  1652.          ;OCL}}}
  1653.          ;OCL{{{  right
  1654.          ( keybind soko-go-or-push-right ( "l ) )
  1655.          ( keybind soko-run-or-push-right ( "L ) )
  1656.          ( keybind soko-run-right ( C-L ) )
  1657.          ;OCL}}}
  1658.          ;OCL{{{  undo
  1659.          ( keybind soko-undo-last-move ( "u ) )
  1660.          ;OCL}}}
  1661.          ;OCL{{{  quit
  1662.          ( keybind soko-quit ( "q ) )
  1663.          ;OCL}}}
  1664.          ;OCL{{{  next
  1665.          ( keybind soko-next-level ( "+ ) )
  1666.          ;OCL}}}
  1667.          ;OCL{{{  previous
  1668.          ( keybind soko-previous-level ( "- ) )
  1669.          ;OCL}}}
  1670.          ;OCL{{{  save
  1671.          ( keybind soko-save ( "s ) )
  1672.          ;OCL}}}
  1673.          ;OCL{{{  reset
  1674.          ( keybind soko-reset ( "r ) )
  1675.          ;OCL}}}
  1676.          ;OCL{{{  restart
  1677.          ( keybind soko-restart-level ( "R ) )
  1678.          ;OCL}}}
  1679.          ;OCL{{{  describe-bindings
  1680.          ( keybind soko-describe-bindings ( "? ) )
  1681.          ;OCL}}}
  1682.       )
  1683.       ;OCL}}}
  1684.       ;OCL{{{  abort-hook-add
  1685.       @if-using not(ABORT-HOOK-ADD)
  1686.          @use (ABORT-HOOK-ADD)
  1687.          ( defmac abort-hook-add ( ) )
  1688.       @fi
  1689.       ( defmac abort-hook-add-saved ( abort-hook-add ) )
  1690.       ( undeclare ( abort-hook-add ) )
  1691.       ( defmac abort-hook-add
  1692.          ( abort-hook-add-saved
  1693.            case
  1694.             ( =(1 soko-regexp) ( delete-mode-regular-expression ) )
  1695.             ( =(2 soko-regexp) ( add-mode-basic-regular-expression ) )
  1696.            esac
  1697.            if soko-play
  1698.             ( set soko-play false
  1699.               set-file-unchanged exit-buffer
  1700.               restore-buffer-layout
  1701.             )
  1702.            fi
  1703.          )
  1704.       )
  1705.       ( undeclare ( abort-hook-add-saved ) )
  1706.       ;OCL}}}
  1707.       ;OCL{{{  reference hooks
  1708.       @if-using ( FUN-REFERENCE ) ; 3 ;
  1709.       The libary defines a macro `abort-hook-add' and a OCL tag ABORT-HOOK-ADD.
  1710.       This macro should be added to your abort-macro! If needed, an existing
  1711.       macro `abort-hook-add' will be integrated!
  1712.  
  1713.       The libary functions are marked as demand-loading.
  1714.  
  1715.       If you do not wnt to use the default file `~/.orisokoban', define the tag
  1716.       and function SOKOBAN-FILE.
  1717.       @fi
  1718.       ;OCL}}}
  1719.       ;OCL{{{  undeclares
  1720.       ( undeclare
  1721.          ( soko-regexp
  1722.            soko-homes
  1723.            soko-play
  1724.            soko-cmd
  1725.            soko-mv
  1726.            soko-pu
  1727.            soko-undo
  1728.            soko-undo-push
  1729.            soko-undo-move
  1730.            soko-undo-i-move
  1731.            soko-saved
  1732.            soko-saved-y
  1733.            soko-saved-x
  1734.            soko-saved-homes
  1735.            soko-saved-mv
  1736.            soko-saved-pu
  1737.            soko-init-boards
  1738.            soko-init-unload
  1739.            soko-quit
  1740.            soko-next-level
  1741.            soko-previous-level
  1742.            soko-save
  1743.            soko-reset
  1744.            soko-action
  1745.            soko-describe-bindings
  1746.            soko-undo-last-move
  1747.            soko-unload
  1748.          )
  1749.       )
  1750.       ;OCL}}}
  1751.    ) )
  1752. @fi
  1753.